結果

問題 No.1863 Xor Sum 2...?
ユーザー irumo8202irumo8202
提出日時 2022-03-04 22:28:29
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 326 bytes
コンパイル時間 280 ms
コンパイル使用メモリ 87,248 KB
実行使用メモリ 100,816 KB
最終ジャッジ日時 2023-09-26 01:35:30
合計ジャッジ時間 4,701 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,416 KB
testcase_01 AC 68 ms
71,308 KB
testcase_02 AC 70 ms
71,296 KB
testcase_03 AC 70 ms
71,140 KB
testcase_04 AC 69 ms
71,440 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 92 ms
85,928 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 96 ms
91,772 KB
testcase_16 WA -
testcase_17 AC 88 ms
83,032 KB
testcase_18 WA -
testcase_19 AC 85 ms
80,648 KB
testcase_20 AC 94 ms
87,648 KB
testcase_21 WA -
testcase_22 AC 85 ms
79,548 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 114 ms
100,720 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 112 ms
100,816 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))


ans = 0
for i in range(N):
    if B[i] == 1:
        continue
    tot = 0
    xor = 0
    j = i
    while (tot + A[j]) - (xor ^ A[j]) == 0 and j >= 0:
        ans += 1
        tot += A[j]
        xor ^= A[j]
        j -= 1

print(ans)
0