ps | |
---|---|
링크 | acmicpc.net/… |
출처 | BOJ |
문제 번호 | 11694 |
문제명 | 님 게임 |
레벨 | 플래티넘 2 |
분류 |
게임이론 |
시간복잡도 | O(n) |
인풋사이즈 | n<=100 |
사용한 언어 | Python 3.11 |
제출기록 | 34248KB / 80ms |
최고기록 | 40ms |
해결날짜 | 2023/06/17 |
"""Solution code for "BOJ 11694. 님 게임".
- Problem link: https://www.acmicpc.net/problem/11694
- Solution link: http://www.teferi.net/ps/problems/boj/11694
Tags: [game theory]
"""
import functools
import operator
def main():
N = int(input())
P = [int(x) for x in input().split()]
if max(P) == 1:
print('koosaga' if N % 2 == 0 else 'cubelover')
else:
grundy = functools.reduce(operator.xor, P)
print('koosaga' if grundy != 0 else 'cubelover')
if __name__ == '__main__':
main()