結果

問題 No.313 π
ユーザー mokemokomokemoko
提出日時 2016-11-02 09:35:37
言語 Ruby
(3.3.0)
結果
AC  
実行時間 172 ms / 5,000 ms
コード長 312 bytes
コンパイル時間 69 ms
コンパイル使用メモリ 11,352 KB
実行使用メモリ 25,572 KB
最終ジャッジ日時 2023-08-16 12:35:23
合計ジャッジ時間 7,295 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 166 ms
25,508 KB
testcase_01 AC 168 ms
25,352 KB
testcase_02 AC 172 ms
25,472 KB
testcase_03 AC 168 ms
25,368 KB
testcase_04 AC 168 ms
25,292 KB
testcase_05 AC 168 ms
25,244 KB
testcase_06 AC 168 ms
25,212 KB
testcase_07 AC 167 ms
25,560 KB
testcase_08 AC 167 ms
25,520 KB
testcase_09 AC 169 ms
25,264 KB
testcase_10 AC 169 ms
25,320 KB
testcase_11 AC 168 ms
25,568 KB
testcase_12 AC 167 ms
25,348 KB
testcase_13 AC 166 ms
25,464 KB
testcase_14 AC 165 ms
25,416 KB
testcase_15 AC 166 ms
25,488 KB
testcase_16 AC 166 ms
25,460 KB
testcase_17 AC 166 ms
25,244 KB
testcase_18 AC 172 ms
25,484 KB
testcase_19 AC 168 ms
25,572 KB
testcase_20 AC 168 ms
25,236 KB
testcase_21 AC 169 ms
25,468 KB
testcase_22 AC 167 ms
25,372 KB
testcase_23 AC 171 ms
25,368 KB
testcase_24 AC 168 ms
25,504 KB
testcase_25 AC 167 ms
25,476 KB
testcase_26 AC 168 ms
25,256 KB
testcase_27 AC 172 ms
25,172 KB
testcase_28 AC 168 ms
25,472 KB
testcase_29 AC 169 ms
25,476 KB
testcase_30 AC 168 ms
25,240 KB
testcase_31 AC 170 ms
25,356 KB
testcase_32 AC 168 ms
25,396 KB
testcase_33 AC 166 ms
25,324 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

f = {"0"=>20104, "1"=>20063, "2"=>19892, "3"=>20011, "4"=>19874, "5"=>20199, "6"=>19898, "7"=>20163, "8"=>19956, "9"=>19841}

h = (0..9).map {|v| [v.to_s, 0]}.to_h
s = STDIN.gets.chomp
s.slice!(1)
s.chars.each {|v| h[v]+=1}

a = f.keys.find {|k| f[k] < h[k] }
b = f.keys.find {|k| f[k] > h[k] }

puts "#{a} #{b}"
0