結果

問題 No.1863 Xor Sum 2...?
ユーザー shiomusubi496shiomusubi496
提出日時 2022-02-25 19:54:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 120 ms / 2,000 ms
コード長 374 bytes
コンパイル時間 298 ms
コンパイル使用メモリ 86,736 KB
実行使用メモリ 100,424 KB
最終ジャッジ日時 2023-09-25 22:31:35
合計ジャッジ時間 4,862 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
70,920 KB
testcase_01 AC 70 ms
71,040 KB
testcase_02 AC 70 ms
71,264 KB
testcase_03 AC 71 ms
70,992 KB
testcase_04 AC 72 ms
71,008 KB
testcase_05 AC 90 ms
77,984 KB
testcase_06 AC 83 ms
76,404 KB
testcase_07 AC 90 ms
81,788 KB
testcase_08 AC 89 ms
81,784 KB
testcase_09 AC 115 ms
99,428 KB
testcase_10 AC 109 ms
97,192 KB
testcase_11 AC 92 ms
85,520 KB
testcase_12 AC 90 ms
81,712 KB
testcase_13 AC 101 ms
91,796 KB
testcase_14 AC 112 ms
97,144 KB
testcase_15 AC 101 ms
91,356 KB
testcase_16 AC 100 ms
92,200 KB
testcase_17 AC 89 ms
82,504 KB
testcase_18 AC 81 ms
76,864 KB
testcase_19 AC 87 ms
80,676 KB
testcase_20 AC 95 ms
87,604 KB
testcase_21 AC 106 ms
94,772 KB
testcase_22 AC 89 ms
79,368 KB
testcase_23 AC 114 ms
99,832 KB
testcase_24 AC 116 ms
99,872 KB
testcase_25 AC 117 ms
100,384 KB
testcase_26 AC 116 ms
100,232 KB
testcase_27 AC 120 ms
100,392 KB
testcase_28 AC 119 ms
100,416 KB
testcase_29 AC 117 ms
100,288 KB
testcase_30 AC 116 ms
100,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

max_a = max(a).bit_length()
ans = 0

for i in range(n):
    a_r = b_r = 0
    for j in range(i, min(n, i+max_a)):
        if a_r & a[j] != 0:
            break
        else:
            a_r |= a[j]
            b_r ^= b[j]
            if b_r == 0:
                ans += 1

print(ans)
0