結果
問題 | No.524 コインゲーム |
ユーザー |
|
提出日時 | 2020-05-08 03:41:49 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 34 ms / 1,000 ms |
コード長 | 991 bytes |
コンパイル時間 | 317 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 11,008 KB |
最終ジャッジ日時 | 2024-09-13 02:12:42 |
合計ジャッジ時間 | 2,677 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 32 |
ソースコード
import sys, refrom collections import deque, defaultdict, Counterfrom math import ceil, sqrt, hypot, factorial, pi, sin, cos, radiansfrom itertools import accumulate, permutations, combinations, product, groupby, combinations_with_replacementfrom operator import itemgetter, mulfrom copy import deepcopyfrom string import ascii_lowercase, ascii_uppercase, digitsfrom bisect import bisect, bisect_leftfrom math import gcdfrom heapq import heappush, heappopfrom functools import reducedef input(): return sys.stdin.readline().strip()def INT(): return int(input())def MAP(): return map(int, input().split())def LIST(): return list(map(int, input().split()))def ZIP(n): return zip(*(MAP() for _ in range(n)))sys.setrecursionlimit(10 ** 9)INF = float('inf')mod = 10 ** 9 + 7def f(n):if n%2 == 1:if ((n+1)//2)%2 == 0:return 0else:return 1else:return f(n-1)^nN = INT()if f(N) == 0:print("X")else:print("O")