結果

問題 No.1863 Xor Sum 2...?
ユーザー ShirotsumeShirotsume
提出日時 2022-03-05 16:13:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 803 ms / 2,000 ms
コード長 386 bytes
コンパイル時間 370 ms
コンパイル使用メモリ 87,080 KB
実行使用メモリ 100,880 KB
最終ジャッジ日時 2023-09-27 03:42:58
合計ジャッジ時間 15,216 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,164 KB
testcase_01 AC 72 ms
71,316 KB
testcase_02 AC 73 ms
71,368 KB
testcase_03 AC 72 ms
71,120 KB
testcase_04 AC 72 ms
71,364 KB
testcase_05 AC 209 ms
79,044 KB
testcase_06 AC 145 ms
77,560 KB
testcase_07 AC 300 ms
82,676 KB
testcase_08 AC 295 ms
82,428 KB
testcase_09 AC 640 ms
99,812 KB
testcase_10 AC 585 ms
97,620 KB
testcase_11 AC 371 ms
86,232 KB
testcase_12 AC 287 ms
82,572 KB
testcase_13 AC 493 ms
91,892 KB
testcase_14 AC 589 ms
97,476 KB
testcase_15 AC 486 ms
91,912 KB
testcase_16 AC 502 ms
91,952 KB
testcase_17 AC 317 ms
83,792 KB
testcase_18 AC 183 ms
77,956 KB
testcase_19 AC 271 ms
81,408 KB
testcase_20 AC 407 ms
87,888 KB
testcase_21 AC 543 ms
94,964 KB
testcase_22 AC 248 ms
80,492 KB
testcase_23 AC 674 ms
100,256 KB
testcase_24 AC 755 ms
100,256 KB
testcase_25 AC 803 ms
100,800 KB
testcase_26 AC 763 ms
100,736 KB
testcase_27 AC 751 ms
100,880 KB
testcase_28 AC 789 ms
100,752 KB
testcase_29 AC 756 ms
100,772 KB
testcase_30 AC 752 ms
100,840 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
cnt = 0
for l in range(1, 40):
    for i in range(n - l + 1):
        x = a[i:i + l]
        y = b[i:i + l]
        n1 = 0
        n2 = 0
        n3 = 0
        for v in x:
            n1 += v
            n2 ^= v
        for v in y:
            n3 ^= v
        if n1 - n2 == n3: cnt += 1
print(cnt)
0