結果

問題 No.667 Mice's Luck(ネズミ達の運)
ユーザー finefine
提出日時 2018-03-23 22:24:51
言語 Ruby
(3.3.0)
結果
AC  
実行時間 587 ms / 2,000 ms
コード長 218 bytes
コンパイル時間 158 ms
コンパイル使用メモリ 11,548 KB
実行使用メモリ 17,352 KB
最終ジャッジ日時 2023-09-07 02:59:41
合計ジャッジ時間 4,785 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
15,064 KB
testcase_01 AC 78 ms
15,308 KB
testcase_02 AC 77 ms
15,100 KB
testcase_03 AC 80 ms
15,232 KB
testcase_04 AC 83 ms
15,276 KB
testcase_05 AC 133 ms
16,376 KB
testcase_06 AC 347 ms
16,772 KB
testcase_07 AC 587 ms
17,352 KB
testcase_08 AC 456 ms
16,760 KB
testcase_09 AC 444 ms
16,876 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

s = gets.chomp
n = s.size
ans = Array.new(n)
o = 0
x = 0
(n-1).downto(0) do |i|
    if s[i] == 'o'
        o += 1
    else
        x += 1
    end
    ans[i] = o.to_f / (o + x)
end

n.times do |i|
    p ans[i] * 100
end
0