結果

問題 No.182 新規性の虜
ユーザー shi-moshi-mo
提出日時 2016-04-03 18:18:39
言語 Ruby
(3.3.0)
結果
AC  
実行時間 182 ms / 5,000 ms
コード長 139 bytes
コンパイル時間 247 ms
コンパイル使用メモリ 11,460 KB
実行使用メモリ 26,472 KB
最終ジャッジ日時 2023-08-27 11:15:04
合計ジャッジ時間 5,405 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,236 KB
testcase_01 AC 82 ms
15,152 KB
testcase_02 AC 82 ms
15,164 KB
testcase_03 AC 80 ms
15,028 KB
testcase_04 AC 81 ms
15,264 KB
testcase_05 AC 81 ms
15,084 KB
testcase_06 AC 82 ms
15,148 KB
testcase_07 AC 82 ms
15,244 KB
testcase_08 AC 129 ms
20,864 KB
testcase_09 AC 160 ms
25,284 KB
testcase_10 AC 149 ms
24,544 KB
testcase_11 AC 136 ms
21,276 KB
testcase_12 AC 104 ms
17,788 KB
testcase_13 AC 81 ms
15,088 KB
testcase_14 AC 82 ms
15,140 KB
testcase_15 AC 79 ms
15,136 KB
testcase_16 AC 82 ms
15,264 KB
testcase_17 AC 82 ms
15,316 KB
testcase_18 AC 137 ms
20,632 KB
testcase_19 AC 123 ms
19,116 KB
testcase_20 AC 106 ms
17,496 KB
testcase_21 AC 145 ms
21,288 KB
testcase_22 AC 115 ms
18,084 KB
testcase_23 AC 80 ms
15,144 KB
testcase_24 AC 182 ms
26,472 KB
testcase_25 AC 151 ms
22,192 KB
testcase_26 AC 89 ms
16,084 KB
testcase_27 AC 82 ms
15,208 KB
evil01.txt AC 184 ms
26,944 KB
evil02.txt AC 181 ms
26,908 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - n
Syntax OK

ソースコード

diff #

n = gets.to_i
a = gets.chomp!.split.map(&:to_i)

c = {}
a.each{|ai| c[ai] ||= 0; c[ai] += 1 }
puts (a.group_by{|ai| c[ai] }[1] || []).size
0