結果

問題 No.1876 Xor of Sum
ユーザー lloyzlloyz
提出日時 2022-03-13 22:39:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 682 ms / 2,000 ms
コード長 206 bytes
コンパイル時間 170 ms
コンパイル使用メモリ 81,552 KB
実行使用メモリ 258,488 KB
最終ジャッジ日時 2023-10-19 10:05:45
合計ジャッジ時間 10,067 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,332 KB
testcase_01 AC 39 ms
53,332 KB
testcase_02 AC 39 ms
53,332 KB
testcase_03 AC 103 ms
79,820 KB
testcase_04 AC 254 ms
189,168 KB
testcase_05 AC 49 ms
62,468 KB
testcase_06 AC 419 ms
257,924 KB
testcase_07 AC 51 ms
64,756 KB
testcase_08 AC 48 ms
62,524 KB
testcase_09 AC 215 ms
157,348 KB
testcase_10 AC 87 ms
78,880 KB
testcase_11 AC 344 ms
257,940 KB
testcase_12 AC 103 ms
79,880 KB
testcase_13 AC 187 ms
129,892 KB
testcase_14 AC 124 ms
81,284 KB
testcase_15 AC 164 ms
108,124 KB
testcase_16 AC 48 ms
62,352 KB
testcase_17 AC 369 ms
257,948 KB
testcase_18 AC 421 ms
258,200 KB
testcase_19 AC 417 ms
258,048 KB
testcase_20 AC 415 ms
258,012 KB
testcase_21 AC 421 ms
257,928 KB
testcase_22 AC 434 ms
257,996 KB
testcase_23 AC 681 ms
258,152 KB
testcase_24 AC 678 ms
258,460 KB
testcase_25 AC 679 ms
258,152 KB
testcase_26 AC 682 ms
258,180 KB
testcase_27 AC 677 ms
258,228 KB
testcase_28 AC 668 ms
258,488 KB
testcase_29 AC 46 ms
59,856 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

dp = 1
for i in range(n):
    dp ^= dp << A[i]

ans = 0
T = bin(dp)
for i in range(1, len(T) - 2):
    if T[-1 - i] == '1':
        ans ^= i
print(ans)
0