結果

問題 No.921 ずんだアロー
ユーザー 💕💖💞💕💖💞
提出日時 2019-11-13 18:04:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 94 ms / 2,000 ms
コード長 362 bytes
コンパイル時間 224 ms
コンパイル使用メモリ 11,748 KB
実行使用メモリ 21,660 KB
最終ジャッジ日時 2023-10-21 19:46:15
合計ジャッジ時間 2,645 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,148 KB
testcase_01 AC 30 ms
10,148 KB
testcase_02 AC 29 ms
10,148 KB
testcase_03 AC 30 ms
10,148 KB
testcase_04 AC 30 ms
10,148 KB
testcase_05 AC 30 ms
10,148 KB
testcase_06 AC 30 ms
10,176 KB
testcase_07 AC 30 ms
10,156 KB
testcase_08 AC 29 ms
10,148 KB
testcase_09 AC 29 ms
10,152 KB
testcase_10 AC 91 ms
20,748 KB
testcase_11 AC 93 ms
21,172 KB
testcase_12 AC 44 ms
12,412 KB
testcase_13 AC 76 ms
18,128 KB
testcase_14 AC 82 ms
19,240 KB
testcase_15 AC 60 ms
15,304 KB
testcase_16 AC 34 ms
10,848 KB
testcase_17 AC 82 ms
19,344 KB
testcase_18 AC 91 ms
21,660 KB
testcase_19 AC 92 ms
21,660 KB
testcase_20 AC 91 ms
21,660 KB
testcase_21 AC 91 ms
21,656 KB
testcase_22 AC 90 ms
21,660 KB
testcase_23 AC 94 ms
21,640 KB
testcase_24 AC 90 ms
21,660 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter
import math
n = int(input())
xx = list(map(int,input().split()))
ll = [0]*n

c = 0
for i in range(n):
    if i == 0:
        c += 1
        ll[i] = 1
    else:
        if xx[i-1] == xx[i]:
            c += 1
            ll[i] = 1
        else:
            if ll[i-1] != 1:
                ll[i] = 1
                c += 1
print(c)
0