結果
| 問題 |
No.1863 Xor Sum 2...?
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-03-04 22:18:51 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 333 bytes |
| コンパイル時間 | 314 ms |
| コンパイル使用メモリ | 82,432 KB |
| 実行使用メモリ | 103,168 KB |
| 最終ジャッジ日時 | 2024-07-18 20:48:48 |
| 合計ジャッジ時間 | 3,475 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 WA * 19 |
ソースコード
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
ans = int(B[0] == 0)
for i in range(1, N):
if B[i] == 1:
continue
tot = A[i]
xor = A[i]
j = i - 1
while tot - xor == 0 and j >= 0:
ans += 1
tot += A[j]
xor ^= A[j]
j -= 1
print(ans)