結果
問題 | No.153 石の山 |
ユーザー |
![]() |
提出日時 | 2020-01-23 08:51:30 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 30 ms / 5,000 ms |
コード長 | 407 bytes |
コンパイル時間 | 80 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-07-18 12:44:48 |
合計ジャッジ時間 | 1,836 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 27 |
ソースコード
import syssys.setrecursionlimit(10 ** 6)def II(): return int(sys.stdin.readline())def main():def g(x):if x==1:return 0if x==2:return 1ret=set()d2=x//2ret.add(g(d2)^g(x-d2))d3=(x+1)//3ret.add(g(x-d3*2))for res in range(3):if res not in ret:return resn=II()if g(n):print("A")else:print("B")main()