結果

問題 No.1183 コイン遊び
ユーザー ssmkzkssmkzk
提出日時 2020-10-09 00:06:08
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 888 ms / 2,000 ms
コード長 521 bytes
コンパイル時間 108 ms
コンパイル使用メモリ 10,712 KB
実行使用メモリ 56,552 KB
最終ジャッジ日時 2023-09-27 12:08:51
合計ジャッジ時間 22,052 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
7,744 KB
testcase_01 AC 13 ms
7,812 KB
testcase_02 AC 14 ms
7,724 KB
testcase_03 AC 14 ms
7,752 KB
testcase_04 AC 13 ms
7,728 KB
testcase_05 AC 13 ms
7,744 KB
testcase_06 AC 12 ms
7,872 KB
testcase_07 AC 13 ms
7,788 KB
testcase_08 AC 14 ms
7,800 KB
testcase_09 AC 14 ms
7,788 KB
testcase_10 AC 29 ms
8,888 KB
testcase_11 AC 64 ms
10,392 KB
testcase_12 AC 533 ms
38,160 KB
testcase_13 AC 474 ms
32,148 KB
testcase_14 AC 788 ms
49,128 KB
testcase_15 AC 827 ms
51,816 KB
testcase_16 AC 870 ms
56,424 KB
testcase_17 AC 857 ms
56,192 KB
testcase_18 AC 857 ms
56,456 KB
testcase_19 AC 860 ms
56,528 KB
testcase_20 AC 888 ms
56,420 KB
testcase_21 AC 810 ms
56,332 KB
testcase_22 AC 819 ms
56,516 KB
testcase_23 AC 810 ms
56,328 KB
testcase_24 AC 829 ms
56,380 KB
testcase_25 AC 852 ms
56,552 KB
testcase_26 AC 880 ms
56,288 KB
testcase_27 AC 857 ms
56,292 KB
testcase_28 AC 866 ms
56,392 KB
testcase_29 AC 811 ms
56,276 KB
testcase_30 AC 867 ms
56,356 KB
testcase_31 AC 851 ms
56,464 KB
testcase_32 AC 851 ms
56,300 KB
testcase_33 AC 849 ms
56,372 KB
testcase_34 AC 845 ms
51,728 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
lA = [0] + list(map(int, input().split()))
lB = [0] + list(map(int, input().split()))
# ans = 0
# f = 0
# for i in range(N):
#     if lA[i] == lB[i] and f == 1:
#         ans +=1
#         f = 0
#     elif lA[i] != lB[i]:
#         f = 1

# if f == 1:
#     print(ans + 1)
# else:
#     print(ans)
lC = []
lD = []
ans = 0
for i in range(len(lA) - 1):
    lC.append(lA[i] ^ lA[i + 1])
    lD.append(lB[i] ^ lB[i + 1])

for i in range(len(lC)):
    if lC[i] != lD[i]:
        ans += 1

print((ans+1) // 2)
0