結果

問題 No.182 新規性の虜
ユーザー 小指が強い人
提出日時 2015-11-10 00:53:19
言語 Ruby
(3.4.1)
結果
AC  
実行時間 159 ms / 5,000 ms
コード長 226 bytes
コンパイル時間 169 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 19,328 KB
最終ジャッジ日時 2024-12-26 19:58:22
合計ジャッジ時間 4,823 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n = gets.to_i
a = gets.split.map(&:to_i)
a.sort!
a.push(0)
count = 0
i = 0
while i < n
    c = a[i]
    s = i
    i += 1
    while c == a[i] do
        i += 1
    end
    if s + 1 == i
        count += 1
    end
end
puts count
0