結果

問題 No.1183 コイン遊び
ユーザー miya145592miya145592
提出日時 2023-05-15 23:28:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 448 ms / 2,000 ms
コード長 313 bytes
コンパイル時間 2,043 ms
コンパイル使用メモリ 84,788 KB
実行使用メモリ 272,884 KB
最終ジャッジ日時 2023-08-20 21:55:56
合計ジャッジ時間 15,377 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
71,220 KB
testcase_01 AC 80 ms
71,292 KB
testcase_02 AC 80 ms
71,180 KB
testcase_03 AC 80 ms
71,112 KB
testcase_04 AC 77 ms
71,080 KB
testcase_05 AC 79 ms
71,344 KB
testcase_06 AC 78 ms
71,116 KB
testcase_07 AC 79 ms
70,900 KB
testcase_08 AC 81 ms
75,488 KB
testcase_09 AC 84 ms
75,420 KB
testcase_10 AC 90 ms
77,604 KB
testcase_11 AC 104 ms
89,864 KB
testcase_12 AC 394 ms
222,600 KB
testcase_13 AC 383 ms
209,324 KB
testcase_14 AC 400 ms
267,404 KB
testcase_15 AC 420 ms
272,424 KB
testcase_16 AC 448 ms
272,508 KB
testcase_17 AC 436 ms
272,476 KB
testcase_18 AC 433 ms
272,476 KB
testcase_19 AC 443 ms
272,596 KB
testcase_20 AC 436 ms
272,460 KB
testcase_21 AC 404 ms
272,204 KB
testcase_22 AC 397 ms
272,280 KB
testcase_23 AC 393 ms
272,344 KB
testcase_24 AC 397 ms
272,536 KB
testcase_25 AC 436 ms
272,668 KB
testcase_26 AC 447 ms
272,552 KB
testcase_27 AC 436 ms
272,532 KB
testcase_28 AC 444 ms
272,520 KB
testcase_29 AC 402 ms
272,348 KB
testcase_30 AC 441 ms
272,484 KB
testcase_31 AC 439 ms
272,532 KB
testcase_32 AC 448 ms
272,884 KB
testcase_33 AC 439 ms
272,600 KB
testcase_34 AC 419 ms
272,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
D = [[-1, -1]]
for i in range(N):
    if A[i]==B[i]:
        if D[-1][1]==i-1:
            D[-1][1] = i
        else:
            D.append([i, i])
if D[-1][1]==N-1:
    D[-1][1] = N
else:
    D.append([N, N])
print(len(D)-1)
0