結果

問題 No.182 新規性の虜
ユーザー 小指が強い人小指が強い人
提出日時 2015-11-10 00:53:19
言語 Ruby
(3.3.0)
結果
AC  
実行時間 138 ms / 5,000 ms
コード長 226 bytes
コンパイル時間 66 ms
コンパイル使用メモリ 11,528 KB
実行使用メモリ 22,376 KB
最終ジャッジ日時 2023-08-27 07:39:09
合計ジャッジ時間 4,473 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
15,132 KB
testcase_01 AC 82 ms
15,044 KB
testcase_02 AC 81 ms
15,232 KB
testcase_03 AC 80 ms
15,288 KB
testcase_04 AC 86 ms
15,048 KB
testcase_05 AC 81 ms
15,072 KB
testcase_06 AC 81 ms
15,076 KB
testcase_07 AC 80 ms
15,024 KB
testcase_08 AC 115 ms
18,996 KB
testcase_09 AC 134 ms
21,400 KB
testcase_10 AC 128 ms
20,640 KB
testcase_11 AC 121 ms
19,656 KB
testcase_12 AC 101 ms
16,668 KB
testcase_13 AC 82 ms
15,132 KB
testcase_14 AC 81 ms
15,208 KB
testcase_15 AC 81 ms
15,152 KB
testcase_16 AC 80 ms
15,024 KB
testcase_17 AC 82 ms
15,104 KB
testcase_18 AC 124 ms
20,304 KB
testcase_19 AC 112 ms
18,796 KB
testcase_20 AC 101 ms
17,396 KB
testcase_21 AC 126 ms
20,992 KB
testcase_22 AC 106 ms
17,772 KB
testcase_23 AC 84 ms
15,104 KB
testcase_24 AC 138 ms
22,376 KB
testcase_25 AC 130 ms
22,156 KB
testcase_26 AC 90 ms
15,500 KB
testcase_27 AC 82 ms
15,132 KB
evil01.txt AC 140 ms
22,952 KB
evil02.txt AC 139 ms
22,784 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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