結果

問題 No.921 ずんだアロー
ユーザー pgDora56pgDora56
提出日時 2019-11-18 01:46:27
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 97 ms / 2,000 ms
コード長 251 bytes
コンパイル時間 548 ms
コンパイル使用メモリ 11,668 KB
実行使用メモリ 21,456 KB
最終ジャッジ日時 2023-10-25 21:41:00
合計ジャッジ時間 3,815 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
9,940 KB
testcase_01 AC 26 ms
9,940 KB
testcase_02 AC 27 ms
9,940 KB
testcase_03 AC 26 ms
9,940 KB
testcase_04 AC 26 ms
9,940 KB
testcase_05 AC 26 ms
9,940 KB
testcase_06 AC 27 ms
9,968 KB
testcase_07 AC 26 ms
9,948 KB
testcase_08 AC 26 ms
9,940 KB
testcase_09 AC 26 ms
9,944 KB
testcase_10 AC 73 ms
20,544 KB
testcase_11 AC 76 ms
21,092 KB
testcase_12 AC 37 ms
12,208 KB
testcase_13 AC 63 ms
17,924 KB
testcase_14 AC 67 ms
19,036 KB
testcase_15 AC 51 ms
15,092 KB
testcase_16 AC 30 ms
10,640 KB
testcase_17 AC 69 ms
19,564 KB
testcase_18 AC 92 ms
21,456 KB
testcase_19 AC 91 ms
21,456 KB
testcase_20 AC 92 ms
21,456 KB
testcase_21 AC 97 ms
21,452 KB
testcase_22 AC 90 ms
21,456 KB
testcase_23 AC 78 ms
21,436 KB
testcase_24 AC 94 ms
21,456 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))
lis = [False] * n

cnt = 1
lis[0] = True
for i in range(1,n):
    if not lis[i-1]:
        lis[i] = True
        cnt += 1
    elif a[i-1] == a[i]:
        lis[i] = True
        cnt += 1

print(cnt)
0