結果

問題 No.1876 Xor of Sum
ユーザー ああいいああいい
提出日時 2022-03-13 21:56:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 697 ms / 2,000 ms
コード長 282 bytes
コンパイル時間 165 ms
コンパイル使用メモリ 81,564 KB
実行使用メモリ 258,452 KB
最終ジャッジ日時 2023-10-19 09:22:39
合計ジャッジ時間 10,319 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
53,284 KB
testcase_01 AC 39 ms
53,284 KB
testcase_02 AC 40 ms
53,284 KB
testcase_03 AC 104 ms
79,784 KB
testcase_04 AC 255 ms
189,132 KB
testcase_05 AC 50 ms
62,432 KB
testcase_06 AC 418 ms
257,884 KB
testcase_07 AC 50 ms
64,720 KB
testcase_08 AC 47 ms
62,488 KB
testcase_09 AC 215 ms
157,312 KB
testcase_10 AC 88 ms
78,836 KB
testcase_11 AC 341 ms
257,904 KB
testcase_12 AC 102 ms
79,844 KB
testcase_13 AC 185 ms
129,856 KB
testcase_14 AC 126 ms
81,248 KB
testcase_15 AC 162 ms
107,968 KB
testcase_16 AC 48 ms
62,316 KB
testcase_17 AC 369 ms
257,880 KB
testcase_18 AC 432 ms
258,168 KB
testcase_19 AC 431 ms
257,976 KB
testcase_20 AC 424 ms
257,980 KB
testcase_21 AC 433 ms
257,896 KB
testcase_22 AC 441 ms
257,964 KB
testcase_23 AC 694 ms
257,764 KB
testcase_24 AC 697 ms
258,428 KB
testcase_25 AC 695 ms
258,116 KB
testcase_26 AC 689 ms
258,144 KB
testcase_27 AC 692 ms
257,956 KB
testcase_28 AC 673 ms
258,452 KB
testcase_29 AC 44 ms
59,828 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
rr = sys.stdin

N = int(rr.readline())
A = list(map(int,rr.readline().split()))

dp = 1
#S = 0
for a in A:
    dp ^= (dp << a)
    #dp = dp << a ^ dp
    #S += a
ans = 0
mask = 1

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