結果
| 問題 | 
                            No.1183 コイン遊び
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2022-10-18 13:11:48 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 1,272 ms / 2,000 ms | 
| コード長 | 597 bytes | 
| コンパイル時間 | 361 ms | 
| コンパイル使用メモリ | 12,672 KB | 
| 実行使用メモリ | 63,528 KB | 
| 最終ジャッジ日時 | 2024-06-28 21:57:27 | 
| 合計ジャッジ時間 | 37,175 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 32 | 
ソースコード
import numpy as np
def main():
    N = int(input())
    A = np.array(list(map(lambda letter: bool(int(letter)), input().split())))
    B = np.array(list(map(lambda letter: bool(int(letter)), input().split())))
    AB_diff = (A == B).tolist()
    left_idx = 0
    ctr = 0
    while left_idx < N:
        try:
            left_idx = AB_diff.index(False, left_idx)
        except ValueError:
            break
        ctr += 1
        try:
            left_idx = AB_diff.index(True, left_idx)
        except ValueError:
            break
    print(ctr)
if __name__ == "__main__":
    main()