結果
| 問題 | 
                            No.1183 コイン遊び
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2020-08-22 13:08:05 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 406 ms / 2,000 ms | 
| コード長 | 354 bytes | 
| コンパイル時間 | 615 ms | 
| コンパイル使用メモリ | 82,176 KB | 
| 実行使用メモリ | 269,664 KB | 
| 最終ジャッジ日時 | 2024-10-15 07:15:37 | 
| 合計ジャッジ時間 | 11,656 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 32 | 
ソースコード
N = int(input())
A = list(map(int, input().split())) + [0]
B = list(map(int, input().split())) + [0]
x = 0
ans = 0
for i in range(N + 1):
    
    if A[i] == B[i] and x == 1:
        
        ans += 1
        
        x = 0
        
    elif A[i] != B[i] and x == 0:
        
        ans += 1
        
        x = 1
        
        
print(ans // 2)