結果
| 問題 | 
                            No.921 ずんだアロー
                             | 
                    
| コンテスト | |
| ユーザー | 
                             pgDora56
                         | 
                    
| 提出日時 | 2019-11-18 01:46:27 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 103 ms / 2,000 ms | 
| コード長 | 251 bytes | 
| コンパイル時間 | 93 ms | 
| コンパイル使用メモリ | 12,544 KB | 
| 実行使用メモリ | 20,972 KB | 
| 最終ジャッジ日時 | 2024-09-25 06:12:05 | 
| 合計ジャッジ時間 | 3,177 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 22 | 
ソースコード
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)
            
            
            
        
            
pgDora56