結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,356 KB
testcase_01 AC 75 ms
71,296 KB
testcase_02 AC 71 ms
71,264 KB
testcase_03 AC 71 ms
71,044 KB
testcase_04 AC 70 ms
71,288 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 90 ms
85,620 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 95 ms
91,772 KB
testcase_16 WA -
testcase_17 AC 87 ms
83,116 KB
testcase_18 WA -
testcase_19 AC 87 ms
80,588 KB
testcase_20 AC 94 ms
87,756 KB
testcase_21 WA -
testcase_22 AC 84 ms
79,740 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 115 ms
100,768 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 116 ms
100,680 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