結果

問題 No.1863 Xor Sum 2...?
ユーザー mkawa2mkawa2
提出日時 2022-03-04 23:03:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 115 ms / 2,000 ms
コード長 980 bytes
コンパイル時間 331 ms
コンパイル使用メモリ 87,040 KB
実行使用メモリ 99,396 KB
最終ジャッジ日時 2023-09-26 02:17:31
合計ジャッジ時間 4,734 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,444 KB
testcase_01 AC 69 ms
71,296 KB
testcase_02 AC 68 ms
71,360 KB
testcase_03 AC 69 ms
71,460 KB
testcase_04 AC 67 ms
71,456 KB
testcase_05 AC 80 ms
78,024 KB
testcase_06 AC 78 ms
76,920 KB
testcase_07 AC 84 ms
81,600 KB
testcase_08 AC 85 ms
81,584 KB
testcase_09 AC 108 ms
98,856 KB
testcase_10 AC 104 ms
96,796 KB
testcase_11 AC 90 ms
85,668 KB
testcase_12 AC 84 ms
81,668 KB
testcase_13 AC 98 ms
91,548 KB
testcase_14 AC 103 ms
96,572 KB
testcase_15 AC 94 ms
91,172 KB
testcase_16 AC 97 ms
91,676 KB
testcase_17 AC 85 ms
82,696 KB
testcase_18 AC 77 ms
76,984 KB
testcase_19 AC 83 ms
80,480 KB
testcase_20 AC 91 ms
87,604 KB
testcase_21 AC 102 ms
94,100 KB
testcase_22 AC 83 ms
79,984 KB
testcase_23 AC 107 ms
96,624 KB
testcase_24 AC 114 ms
99,396 KB
testcase_25 AC 114 ms
99,236 KB
testcase_26 AC 115 ms
99,368 KB
testcase_27 AC 114 ms
99,264 KB
testcase_28 AC 114 ms
99,264 KB
testcase_29 AC 115 ms
99,312 KB
testcase_30 AC 114 ms
99,324 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

# sys.setrecursionlimit(200005)
int1 = lambda x: int(x)-1
pDB = lambda *x: print(*x, end="\n", file=sys.stderr)
p2D = lambda x: print(*x, sep="\n", end="\n\n", file=sys.stderr)
def II(): return int(sys.stdin.readline())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
def SI(): return sys.stdin.readline().rstrip()
dij = [(0, 1), (-1, 0), (0, -1), (1, 0)]
# dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]
inf = (1 << 63)-1
# inf = (1 << 31)-1
md = 10**9+7
# md = 998244353

n = II()
aa = LI()
bb = LI()

ans = 0
for r in range(n):
    x = y = s = t = 0
    for i in range(r, -1, -1):
        if t & aa[i]: break
        t |= aa[i]
        s += aa[i]
        x ^= aa[i]
        y ^= bb[i]
        if s-x == y: ans += 1

print(ans)
0