結果

問題 No.153 石の山
ユーザー gr1msl3ygr1msl3y
提出日時 2022-01-29 13:05:17
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 324 bytes
コンパイル時間 1,672 ms
コンパイル使用メモリ 86,688 KB
実行使用メモリ 71,504 KB
最終ジャッジ日時 2023-08-30 10:42:20
合計ジャッジ時間 4,713 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,280 KB
testcase_01 AC 71 ms
71,240 KB
testcase_02 AC 71 ms
71,320 KB
testcase_03 AC 70 ms
71,324 KB
testcase_04 AC 71 ms
71,196 KB
testcase_05 AC 72 ms
71,332 KB
testcase_06 AC 70 ms
71,296 KB
testcase_07 AC 71 ms
71,324 KB
testcase_08 AC 71 ms
71,284 KB
testcase_09 AC 72 ms
71,280 KB
testcase_10 AC 72 ms
71,076 KB
testcase_11 AC 71 ms
71,328 KB
testcase_12 AC 70 ms
71,092 KB
testcase_13 AC 70 ms
71,300 KB
testcase_14 AC 71 ms
71,504 KB
testcase_15 AC 71 ms
71,316 KB
testcase_16 WA -
testcase_17 AC 71 ms
71,504 KB
testcase_18 AC 72 ms
71,188 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 72 ms
71,092 KB
testcase_22 AC 71 ms
71,504 KB
testcase_23 AC 72 ms
71,284 KB
testcase_24 AC 72 ms
71,352 KB
testcase_25 AC 72 ms
71,324 KB
testcase_26 AC 71 ms
71,376 KB
testcase_27 WA -
testcase_28 AC 71 ms
71,500 KB
testcase_29 WA -
testcase_30 AC 71 ms
71,084 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
gr = [-1]*(N+1)
gr[1] = 0
for i in range(2, N+1):
    S = {gr[i//2] ^ gr[N-i//2]}
    if i > 2:
        if i % 3 == 1:
            S.add(gr[i//3+1])
        else:
            S.add(gr[i//3])
    for j in range(3):
        if j not in S:
            gr[i] = j
            break

print('A' if gr[N] else 'B')
0