結果

問題 No.1876 Xor of Sum
ユーザー lloyzlloyz
提出日時 2022-03-13 22:35:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 242 bytes
コンパイル時間 94 ms
コンパイル使用メモリ 11,776 KB
実行使用メモリ 50,728 KB
最終ジャッジ日時 2023-10-19 10:02:21
合計ジャッジ時間 48,672 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,098 ms
50,696 KB
testcase_01 AC 1,094 ms
50,728 KB
testcase_02 AC 1,098 ms
50,484 KB
testcase_03 AC 1,751 ms
50,484 KB
testcase_04 TLE -
testcase_05 AC 1,240 ms
50,484 KB
testcase_06 TLE -
testcase_07 AC 1,248 ms
50,484 KB
testcase_08 AC 1,228 ms
50,484 KB
testcase_09 TLE -
testcase_10 AC 1,641 ms
50,484 KB
testcase_11 TLE -
testcase_12 AC 1,758 ms
50,484 KB
testcase_13 TLE -
testcase_14 AC 1,903 ms
50,728 KB
testcase_15 AC 1,973 ms
50,728 KB
testcase_16 AC 1,239 ms
50,484 KB
testcase_17 TLE -
testcase_18 TLE -
testcase_19 TLE -
testcase_20 TLE -
testcase_21 TLE -
testcase_22 TLE -
testcase_23 TLE -
testcase_24 TLE -
testcase_25 TLE -
testcase_26 TLE -
testcase_27 TLE -
testcase_28 TLE -
testcase_29 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np

n = int(input())
A = list(map(int, input().split()))
DP = np.zeros(4000005, np.bool_)
DP[0] = 1
for i in range(n):
    DP[A[i]:] ^= DP[:-A[i]]

ans = 0
for i in range(1, 4000001):
    if DP[i]:
        ans ^= i
print(ans)
0