結果

問題 No.313 π
ユーザー LeonardoneLeonardone
提出日時 2015-12-07 01:26:26
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 443 bytes
コンパイル時間 38 ms
コンパイル使用メモリ 11,404 KB
実行使用メモリ 15,868 KB
最終ジャッジ日時 2023-10-12 19:24:38
合計ジャッジ時間 6,605 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 148 ms
15,692 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 147 ms
15,736 KB
testcase_04 AC 149 ms
15,580 KB
testcase_05 AC 148 ms
15,632 KB
testcase_06 AC 148 ms
15,644 KB
testcase_07 AC 148 ms
15,644 KB
testcase_08 AC 148 ms
15,692 KB
testcase_09 AC 148 ms
15,584 KB
testcase_10 AC 149 ms
15,556 KB
testcase_11 AC 147 ms
15,588 KB
testcase_12 AC 148 ms
15,720 KB
testcase_13 AC 148 ms
15,704 KB
testcase_14 AC 147 ms
15,568 KB
testcase_15 AC 148 ms
15,656 KB
testcase_16 AC 149 ms
15,716 KB
testcase_17 AC 147 ms
15,504 KB
testcase_18 AC 147 ms
15,708 KB
testcase_19 AC 145 ms
15,584 KB
testcase_20 AC 147 ms
15,644 KB
testcase_21 AC 149 ms
15,688 KB
testcase_22 AC 148 ms
15,720 KB
testcase_23 AC 148 ms
15,588 KB
testcase_24 AC 147 ms
15,740 KB
testcase_25 AC 147 ms
15,584 KB
testcase_26 WA -
testcase_27 AC 149 ms
15,732 KB
testcase_28 AC 147 ms
15,688 KB
testcase_29 AC 148 ms
15,672 KB
testcase_30 AC 147 ms
15,500 KB
testcase_31 AC 147 ms
15,596 KB
testcase_32 AC 145 ms
15,800 KB
testcase_33 AC 145 ms
15,572 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

#! ruby
# yukicoder My Practice
# author: Leonardone @ NEETSDKASU

# 解説読後
# http://yukicoder.me/problems/686/editorial

s = gets.chomp

a = [0] * 10

s.each_char do |c|
    next if c == '.'
    a[c.to_i] += 1
end

b = [20105, 20063, 19892, 20011, 19874, 20199, 19898, 20163, 19956, 19841]

w = -1
c = -1

10.times do |i|
    d = b[i] - a[i]
    if d > 0
        c = i
    elsif d < 0
        w = i
    end
end

puts "%d %d" % [w, c]


0