結果

問題 No.2538 2進元ゲーム
ユーザー ecotteaecottea
提出日時 2023-09-30 19:22:52
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 483 bytes
コンパイル時間 332 ms
コンパイル使用メモリ 86,808 KB
実行使用メモリ 164,320 KB
最終ジャッジ日時 2023-09-30 22:01:40
合計ジャッジ時間 7,921 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
164,320 KB
testcase_01 AC 75 ms
71,148 KB
testcase_02 AC 74 ms
71,276 KB
testcase_03 AC 74 ms
71,200 KB
testcase_04 AC 75 ms
71,284 KB
testcase_05 AC 74 ms
71,348 KB
testcase_06 AC 74 ms
71,384 KB
testcase_07 AC 74 ms
71,424 KB
testcase_08 AC 74 ms
71,356 KB
testcase_09 AC 74 ms
71,288 KB
testcase_10 AC 76 ms
75,408 KB
testcase_11 AC 76 ms
71,236 KB
testcase_12 AC 78 ms
75,296 KB
testcase_13 AC 78 ms
75,248 KB
testcase_14 AC 75 ms
71,284 KB
testcase_15 AC 77 ms
71,388 KB
testcase_16 AC 75 ms
71,452 KB
testcase_17 AC 77 ms
75,292 KB
testcase_18 AC 74 ms
71,368 KB
testcase_19 AC 78 ms
75,396 KB
testcase_20 AC 76 ms
75,292 KB
testcase_21 AC 73 ms
71,348 KB
testcase_22 AC 74 ms
71,340 KB
testcase_23 AC 77 ms
75,484 KB
testcase_24 AC 77 ms
75,324 KB
testcase_25 AC 75 ms
71,344 KB
testcase_26 AC 74 ms
71,208 KB
testcase_27 AC 91 ms
76,404 KB
testcase_28 AC 97 ms
77,112 KB
testcase_29 AC 135 ms
77,376 KB
testcase_30 AC 454 ms
78,280 KB
testcase_31 TLE -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))

dp = {}

def get_nimber(a):
    if a < 0:
        return 100
    
    if a in dp:
        return dp[a]
    
    ex = [0] * 10
    for i in range(60):
        if a % 2 == 1:
            g = get_nimber(i)
            ex[g] = 1
        a //= 2
    
    for i in range(10):
        if ex[i] == 0:
            return i
    
    return -1

res = 0

for i in range(n):
    g = get_nimber(a[i])
    res ^= g

print(2 if res == 0 else 1)
0