結果
| 問題 | No.313 π |
| コンテスト | |
| ユーザー |
siman
|
| 提出日時 | 2021-04-28 10:19:21 |
| 言語 | Ruby (4.0.2) |
| 結果 |
AC
|
| 実行時間 | 109 ms / 5,000 ms |
| コード長 | 329 bytes |
| 記録 | |
| コンパイル時間 | 105 ms |
| コンパイル使用メモリ | 9,216 KB |
| 実行使用メモリ | 15,360 KB |
| 最終ジャッジ日時 | 2026-03-28 19:33:59 |
| 合計ジャッジ時間 | 4,596 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 32 |
コンパイルメッセージ
Syntax OK
ソースコード
D = [20104, 20063, 19892, 20011, 19874, 20199, 19898, 20163, 19956, 19841]
S = gets.chomp
counter = Hash.new(0)
S.each_char do |s|
counter[s] += 1
end
res = [*'0'..'9'].map { |c| counter[c] }
a = -1
b = -1
10.times do |i|
next if res[i] == D[i]
a = i if res[i] > D[i]
b = i if res[i] < D[i]
end
puts [a, b].join(' ')
siman