結果

問題 No.1876 Xor of Sum
ユーザー brthyyjpbrthyyjp
提出日時 2022-03-19 15:14:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 596 ms / 2,000 ms
コード長 207 bytes
コンパイル時間 250 ms
コンパイル使用メモリ 81,792 KB
実行使用メモリ 259,200 KB
最終ジャッジ日時 2024-04-15 04:34:10
合計ジャッジ時間 8,751 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
52,224 KB
testcase_01 AC 35 ms
51,840 KB
testcase_02 AC 33 ms
51,712 KB
testcase_03 AC 87 ms
80,128 KB
testcase_04 AC 225 ms
190,176 KB
testcase_05 AC 43 ms
62,976 KB
testcase_06 AC 365 ms
258,688 KB
testcase_07 AC 44 ms
64,000 KB
testcase_08 AC 41 ms
62,976 KB
testcase_09 AC 187 ms
158,080 KB
testcase_10 AC 73 ms
79,104 KB
testcase_11 AC 298 ms
258,944 KB
testcase_12 AC 88 ms
80,132 KB
testcase_13 AC 160 ms
130,472 KB
testcase_14 AC 106 ms
81,616 KB
testcase_15 AC 140 ms
108,544 KB
testcase_16 AC 42 ms
61,568 KB
testcase_17 AC 320 ms
258,560 KB
testcase_18 AC 374 ms
258,688 KB
testcase_19 AC 366 ms
258,940 KB
testcase_20 AC 363 ms
258,944 KB
testcase_21 AC 380 ms
258,944 KB
testcase_22 AC 371 ms
258,400 KB
testcase_23 AC 584 ms
258,560 KB
testcase_24 AC 596 ms
258,688 KB
testcase_25 AC 582 ms
258,944 KB
testcase_26 AC 593 ms
259,200 KB
testcase_27 AC 590 ms
258,336 KB
testcase_28 AC 582 ms
258,928 KB
testcase_29 AC 43 ms
62,000 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = list(map(int, input().split()))
N = max(A)*n+1
dp = 1
for a in A:
    dp ^= dp<<a

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