結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,180 KB
testcase_01 AC 29 ms
10,180 KB
testcase_02 AC 28 ms
10,180 KB
testcase_03 AC 29 ms
10,180 KB
testcase_04 AC 29 ms
10,180 KB
testcase_05 AC 28 ms
10,180 KB
testcase_06 AC 29 ms
10,208 KB
testcase_07 AC 28 ms
10,188 KB
testcase_08 AC 28 ms
10,180 KB
testcase_09 AC 28 ms
10,184 KB
testcase_10 AC 92 ms
20,780 KB
testcase_11 AC 94 ms
21,204 KB
testcase_12 AC 43 ms
12,444 KB
testcase_13 AC 75 ms
18,160 KB
testcase_14 AC 83 ms
19,272 KB
testcase_15 AC 59 ms
15,336 KB
testcase_16 AC 33 ms
10,880 KB
testcase_17 AC 85 ms
19,376 KB
testcase_18 AC 91 ms
21,692 KB
testcase_19 AC 92 ms
21,692 KB
testcase_20 AC 92 ms
21,692 KB
testcase_21 AC 91 ms
21,688 KB
testcase_22 AC 95 ms
21,692 KB
testcase_23 AC 95 ms
21,672 KB
testcase_24 AC 90 ms
21,692 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