結果

問題 No.1183 コイン遊び
ユーザー maru65536maru65536
提出日時 2020-08-22 13:04:31
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,365 ms / 2,000 ms
コード長 378 bytes
コンパイル時間 319 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 122,324 KB
最終ジャッジ日時 2024-04-23 07:18:53
合計ジャッジ時間 22,058 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
10,752 KB
testcase_01 AC 25 ms
10,752 KB
testcase_02 AC 26 ms
10,880 KB
testcase_03 AC 28 ms
10,880 KB
testcase_04 AC 25 ms
10,752 KB
testcase_05 AC 25 ms
10,880 KB
testcase_06 AC 27 ms
10,752 KB
testcase_07 AC 27 ms
10,752 KB
testcase_08 AC 27 ms
10,880 KB
testcase_09 AC 27 ms
10,880 KB
testcase_10 AC 40 ms
12,032 KB
testcase_11 AC 72 ms
14,936 KB
testcase_12 AC 554 ms
53,656 KB
testcase_13 AC 489 ms
48,932 KB
testcase_14 AC 834 ms
77,048 KB
testcase_15 AC 935 ms
79,348 KB
testcase_16 AC 946 ms
80,188 KB
testcase_17 AC 948 ms
79,220 KB
testcase_18 AC 952 ms
80,956 KB
testcase_19 AC 963 ms
80,828 KB
testcase_20 AC 944 ms
80,760 KB
testcase_21 AC 559 ms
36,088 KB
testcase_22 AC 548 ms
36,280 KB
testcase_23 AC 574 ms
36,088 KB
testcase_24 AC 561 ms
36,216 KB
testcase_25 AC 951 ms
81,452 KB
testcase_26 AC 962 ms
80,892 KB
testcase_27 AC 949 ms
81,196 KB
testcase_28 AC 959 ms
80,760 KB
testcase_29 AC 562 ms
36,216 KB
testcase_30 AC 1,365 ms
122,324 KB
testcase_31 AC 950 ms
80,956 KB
testcase_32 AC 955 ms
80,824 KB
testcase_33 AC 939 ms
80,112 KB
testcase_34 AC 1,003 ms
79,156 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