結果

問題 No.921 ずんだアロー
ユーザー 💕💖💞
提出日時 2019-11-13 18:04:02
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 100 ms / 2,000 ms
コード長 362 bytes
コンパイル時間 121 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 21,128 KB
最終ジャッジ日時 2024-09-21 21:11:05
合計ジャッジ時間 2,438 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

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