結果

問題 No.1863 Xor Sum 2...?
ユーザー hir355hir355
提出日時 2022-03-04 22:12:20
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 350 bytes
コンパイル時間 463 ms
コンパイル使用メモリ 87,328 KB
実行使用メモリ 101,124 KB
最終ジャッジ日時 2023-09-26 01:16:18
合計ジャッジ時間 5,496 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
71,120 KB
testcase_01 AC 66 ms
70,700 KB
testcase_02 AC 67 ms
70,968 KB
testcase_03 AC 66 ms
71,028 KB
testcase_04 AC 67 ms
71,180 KB
testcase_05 AC 85 ms
77,740 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 95 ms
81,940 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 85 ms
76,560 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
r = 0
ans = 0
bx = 0
sx = 0
ax = 0
for l in range(n):
    while r < n and bx ^ b[r] == 0 and sx + a[r] == ax ^ a[r]:
        bx ^= b[r]
        sx += a[r]
        ax ^= a[r]
        r += 1
    ans += r - l
    bx ^= b[l]
    sx -= a[l]
    ax ^= a[l]
print(ans)
0