結果

問題 No.313 π
ユーザー char134217728char134217728
提出日時 2017-09-07 20:10:43
言語 Ruby
(3.3.0)
結果
AC  
実行時間 203 ms / 5,000 ms
コード長 321 bytes
コンパイル時間 64 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 22,912 KB
最終ジャッジ日時 2024-04-25 01:41:03
合計ジャッジ時間 8,699 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 186 ms
22,784 KB
testcase_01 AC 191 ms
22,656 KB
testcase_02 AC 185 ms
22,784 KB
testcase_03 AC 187 ms
22,656 KB
testcase_04 AC 185 ms
22,528 KB
testcase_05 AC 187 ms
22,528 KB
testcase_06 AC 186 ms
22,784 KB
testcase_07 AC 187 ms
22,784 KB
testcase_08 AC 184 ms
22,528 KB
testcase_09 AC 188 ms
22,656 KB
testcase_10 AC 187 ms
22,656 KB
testcase_11 AC 184 ms
22,656 KB
testcase_12 AC 187 ms
22,656 KB
testcase_13 AC 185 ms
22,656 KB
testcase_14 AC 184 ms
22,784 KB
testcase_15 AC 185 ms
22,656 KB
testcase_16 AC 188 ms
22,528 KB
testcase_17 AC 187 ms
22,784 KB
testcase_18 AC 186 ms
22,656 KB
testcase_19 AC 203 ms
22,656 KB
testcase_20 AC 184 ms
22,528 KB
testcase_21 AC 195 ms
22,528 KB
testcase_22 AC 193 ms
22,400 KB
testcase_23 AC 186 ms
22,656 KB
testcase_24 AC 184 ms
22,656 KB
testcase_25 AC 192 ms
22,656 KB
testcase_26 AC 186 ms
22,912 KB
testcase_27 AC 188 ms
22,400 KB
testcase_28 AC 185 ms
22,528 KB
testcase_29 AC 188 ms
22,400 KB
testcase_30 AC 186 ms
22,656 KB
testcase_31 AC 186 ms
22,528 KB
testcase_32 AC 189 ms
22,656 KB
testcase_33 AC 189 ms
22,528 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

h = {"2"=>19892, "."=>1, "1"=>20063, "4"=>19874, "5"=>20199, "9"=>19841, "6"=>19898, "3"=>20011, "8"=>19956, "7"=>20163, "0"=>20104}
_h = Hash.new{0}
gets.chomp.chars.each do |c|
  _h[c] += 1
end
ans = []
h.each do |k, v|
  if _h[k] > v
    ans[0] = k
  elsif _h[k] < v
    ans[1] = k
  end
end
puts "#{ans[0]} #{ans[1]}"
0