結果

問題 No.1876 Xor of Sum
ユーザー rlangevinrlangevin
提出日時 2023-11-07 23:42:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 761 ms / 2,000 ms
コード長 223 bytes
コンパイル時間 1,008 ms
コンパイル使用メモリ 81,852 KB
実行使用メモリ 258,676 KB
最終ジャッジ日時 2023-11-07 23:42:15
合計ジャッジ時間 12,721 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,460 KB
testcase_01 AC 37 ms
53,460 KB
testcase_02 AC 36 ms
53,460 KB
testcase_03 AC 113 ms
82,168 KB
testcase_04 AC 274 ms
193,140 KB
testcase_05 AC 50 ms
73,180 KB
testcase_06 AC 450 ms
258,036 KB
testcase_07 AC 56 ms
76,476 KB
testcase_08 AC 50 ms
73,512 KB
testcase_09 AC 233 ms
161,012 KB
testcase_10 AC 94 ms
80,260 KB
testcase_11 AC 366 ms
258,036 KB
testcase_12 AC 112 ms
81,556 KB
testcase_13 AC 204 ms
133,304 KB
testcase_14 AC 133 ms
83,976 KB
testcase_15 AC 177 ms
111,220 KB
testcase_16 AC 49 ms
70,976 KB
testcase_17 AC 395 ms
258,164 KB
testcase_18 AC 459 ms
258,420 KB
testcase_19 AC 445 ms
258,164 KB
testcase_20 AC 443 ms
258,164 KB
testcase_21 AC 455 ms
258,036 KB
testcase_22 AC 460 ms
258,164 KB
testcase_23 AC 735 ms
258,292 KB
testcase_24 AC 746 ms
258,676 KB
testcase_25 AC 754 ms
258,292 KB
testcase_26 AC 734 ms
258,420 KB
testcase_27 AC 761 ms
258,548 KB
testcase_28 AC 731 ms
258,676 KB
testcase_29 AC 45 ms
62,236 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))
now = 1
for a in A:
    now = (now << a) ^ now
    
ans = 0
now = bin(now)[2:]
for i, n in enumerate(now[::-1]):
    if n == "1":
        ans ^= i
        
print(ans)    
0