結果

問題 No.1183 コイン遊び
ユーザー ThetaTheta
提出日時 2022-10-18 13:11:48
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 907 ms / 2,000 ms
コード長 597 bytes
コンパイル時間 227 ms
コンパイル使用メモリ 10,988 KB
実行使用メモリ 51,788 KB
最終ジャッジ日時 2023-09-11 07:29:21
合計ジャッジ時間 26,592 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
29,512 KB
testcase_01 AC 135 ms
29,480 KB
testcase_02 AC 131 ms
29,484 KB
testcase_03 AC 134 ms
29,448 KB
testcase_04 AC 135 ms
29,360 KB
testcase_05 AC 135 ms
29,452 KB
testcase_06 AC 133 ms
29,564 KB
testcase_07 AC 136 ms
29,548 KB
testcase_08 AC 135 ms
29,492 KB
testcase_09 AC 137 ms
29,640 KB
testcase_10 AC 150 ms
29,932 KB
testcase_11 AC 183 ms
30,988 KB
testcase_12 AC 605 ms
43,284 KB
testcase_13 AC 550 ms
41,732 KB
testcase_14 AC 826 ms
46,792 KB
testcase_15 AC 875 ms
51,716 KB
testcase_16 AC 872 ms
48,112 KB
testcase_17 AC 879 ms
48,324 KB
testcase_18 AC 890 ms
47,932 KB
testcase_19 AC 878 ms
48,116 KB
testcase_20 AC 873 ms
47,828 KB
testcase_21 AC 787 ms
47,824 KB
testcase_22 AC 791 ms
48,016 KB
testcase_23 AC 804 ms
48,216 KB
testcase_24 AC 806 ms
48,284 KB
testcase_25 AC 879 ms
47,788 KB
testcase_26 AC 876 ms
47,792 KB
testcase_27 AC 876 ms
47,968 KB
testcase_28 AC 882 ms
47,932 KB
testcase_29 AC 794 ms
48,048 KB
testcase_30 AC 907 ms
47,944 KB
testcase_31 AC 891 ms
47,944 KB
testcase_32 AC 885 ms
47,828 KB
testcase_33 AC 879 ms
48,704 KB
testcase_34 AC 875 ms
51,788 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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()
0