結果

問題 No.1183 コイン遊び
ユーザー missionelmissionel
提出日時 2020-08-31 21:10:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 381 ms / 2,000 ms
コード長 364 bytes
コンパイル時間 470 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 260,120 KB
最終ジャッジ日時 2024-04-28 11:11:32
合計ジャッジ時間 10,952 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
51,712 KB
testcase_01 AC 37 ms
51,584 KB
testcase_02 AC 37 ms
51,712 KB
testcase_03 AC 35 ms
51,840 KB
testcase_04 AC 35 ms
51,584 KB
testcase_05 AC 34 ms
52,224 KB
testcase_06 AC 35 ms
51,840 KB
testcase_07 AC 34 ms
51,840 KB
testcase_08 AC 39 ms
58,112 KB
testcase_09 AC 42 ms
58,240 KB
testcase_10 AC 48 ms
66,304 KB
testcase_11 AC 64 ms
81,664 KB
testcase_12 AC 242 ms
204,144 KB
testcase_13 AC 220 ms
198,124 KB
testcase_14 AC 332 ms
238,748 KB
testcase_15 AC 371 ms
259,532 KB
testcase_16 AC 372 ms
259,848 KB
testcase_17 AC 373 ms
259,736 KB
testcase_18 AC 371 ms
259,728 KB
testcase_19 AC 378 ms
259,992 KB
testcase_20 AC 374 ms
260,120 KB
testcase_21 AC 353 ms
259,856 KB
testcase_22 AC 355 ms
259,988 KB
testcase_23 AC 354 ms
259,856 KB
testcase_24 AC 354 ms
259,980 KB
testcase_25 AC 364 ms
259,988 KB
testcase_26 AC 380 ms
259,992 KB
testcase_27 AC 371 ms
259,856 KB
testcase_28 AC 381 ms
259,864 KB
testcase_29 AC 354 ms
259,864 KB
testcase_30 AC 360 ms
259,736 KB
testcase_31 AC 366 ms
259,604 KB
testcase_32 AC 374 ms
259,724 KB
testcase_33 AC 378 ms
259,732 KB
testcase_34 AC 369 ms
259,528 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.buffer.readline

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

ans = 0
changing = False
for i in range(N):
    if A[i] == B[i]:
        if changing:
            changing = False
            ans += 1
    else:
        changing = True

if changing:
    ans += 1

print(ans)
0