結果
問題 |
No.1183 コイン遊び
|
ユーザー |
![]() |
提出日時 | 2020-10-02 19:38:23 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 508 ms / 2,000 ms |
コード長 | 550 bytes |
コンパイル時間 | 140 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 281,476 KB |
最終ジャッジ日時 | 2024-07-16 02:15:42 |
合計ジャッジ時間 | 14,528 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 32 |
ソースコード
from collections import Counter,defaultdict,deque from heapq import heappop,heappush from bisect import bisect_left,bisect_right import sys,math,itertools,fractions,pprint sys.setrecursionlimit(10**8) mod = 10**9+7 INF = float('inf') def inp(): return int(sys.stdin.readline()) def inpl(): return list(map(int, sys.stdin.readline().split())) n = inp() a = inpl() b = inpl() f = False res = 0 for i in range(n): if not f and a[i] != b[i]: f = True elif f and a[i] == b[i]: f = False res += 1 if f: res += 1 print(res)