結果
問題 | No.1863 Xor Sum 2...? |
ユーザー | irumo8202 |
提出日時 | 2022-03-04 22:18:51 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 333 bytes |
コンパイル時間 | 334 ms |
コンパイル使用メモリ | 87,268 KB |
実行使用メモリ | 101,124 KB |
最終ジャッジ日時 | 2023-09-26 01:22:49 |
合計ジャッジ時間 | 4,688 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 67 ms
71,476 KB |
testcase_01 | AC | 68 ms
71,384 KB |
testcase_02 | AC | 68 ms
71,432 KB |
testcase_03 | AC | 68 ms
71,428 KB |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | AC | 88 ms
85,880 KB |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | AC | 93 ms
91,836 KB |
testcase_16 | WA | - |
testcase_17 | AC | 83 ms
82,832 KB |
testcase_18 | WA | - |
testcase_19 | AC | 81 ms
80,712 KB |
testcase_20 | AC | 90 ms
87,724 KB |
testcase_21 | WA | - |
testcase_22 | AC | 78 ms
79,808 KB |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | AC | 109 ms
100,708 KB |
testcase_28 | WA | - |
testcase_29 | WA | - |
testcase_30 | AC | 107 ms
100,712 KB |
ソースコード
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)