結果

問題 No.921 ずんだアロー
ユーザー yuly3
提出日時 2020-01-08 10:20:40
言語 Nim
(2.2.0)
結果
AC  
実行時間 17 ms / 2,000 ms
コード長 391 bytes
コンパイル時間 3,859 ms
コンパイル使用メモリ 65,152 KB
実行使用メモリ 8,704 KB
最終ジャッジ日時 2024-11-23 02:22:00
合計ジャッジ時間 5,068 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

import sequtils, strutils

proc solve() =
    var
        N = stdin.readLine.parseInt()
        A = stdin.readLine.split.map(parseInt)
        ans = 1
        flg = true
    
    for i in 1..<N:
        if flg:
            if A[i-1] == A[i]:
                inc ans
            else:
                flg = false
        else:
            inc ans
            flg = true
    echo ans

solve()
0