結果

問題 No.1183 コイン遊び
ユーザー maru65536maru65536
提出日時 2020-08-22 13:04:31
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,353 ms / 2,000 ms
コード長 378 bytes
コンパイル時間 216 ms
コンパイル使用メモリ 10,820 KB
実行使用メモリ 121,176 KB
最終ジャッジ日時 2023-08-05 09:44:40
合計ジャッジ時間 20,990 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,716 KB
testcase_01 AC 15 ms
7,824 KB
testcase_02 AC 16 ms
7,792 KB
testcase_03 AC 15 ms
7,828 KB
testcase_04 AC 15 ms
7,828 KB
testcase_05 AC 15 ms
7,804 KB
testcase_06 AC 15 ms
7,884 KB
testcase_07 AC 15 ms
7,764 KB
testcase_08 AC 15 ms
7,820 KB
testcase_09 AC 15 ms
7,816 KB
testcase_10 AC 28 ms
9,452 KB
testcase_11 AC 58 ms
12,316 KB
testcase_12 AC 525 ms
51,000 KB
testcase_13 AC 473 ms
46,080 KB
testcase_14 AC 807 ms
73,068 KB
testcase_15 AC 917 ms
76,484 KB
testcase_16 AC 922 ms
77,100 KB
testcase_17 AC 935 ms
77,020 KB
testcase_18 AC 933 ms
78,912 KB
testcase_19 AC 907 ms
78,988 KB
testcase_20 AC 919 ms
79,004 KB
testcase_21 AC 469 ms
34,864 KB
testcase_22 AC 475 ms
35,836 KB
testcase_23 AC 487 ms
34,140 KB
testcase_24 AC 491 ms
34,456 KB
testcase_25 AC 924 ms
79,156 KB
testcase_26 AC 936 ms
78,956 KB
testcase_27 AC 935 ms
78,968 KB
testcase_28 AC 930 ms
78,964 KB
testcase_29 AC 482 ms
35,688 KB
testcase_30 AC 1,353 ms
121,176 KB
testcase_31 AC 929 ms
79,920 KB
testcase_32 AC 921 ms
79,260 KB
testcase_33 AC 911 ms
78,220 KB
testcase_34 AC 925 ms
77,736 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def r(a): #圧縮された要素を保持
    ll,l=[],1
    for i in range(len(a)-1):
        if a[i]==a[i+1]:
            l+=1
        else:
            ll.append([l,a[i]])
            l=1
    ll.append([l,a[-1]])
    return ll

n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=r([a[i]^b[i] for i in range(n)])
print(sum([i[1]==1 for i in c]))
0