結果

問題 No.667 Mice's Luck(ネズミ達の運)
ユーザー wonda_t_coffeewonda_t_coffee
提出日時 2020-02-06 23:00:41
言語 Ruby
(3.3.0)
結果
AC  
実行時間 345 ms / 2,000 ms
コード長 222 bytes
コンパイル時間 64 ms
コンパイル使用メモリ 11,984 KB
実行使用メモリ 25,704 KB
最終ジャッジ日時 2023-10-25 22:42:36
合計ジャッジ時間 3,629 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
16,196 KB
testcase_01 AC 79 ms
16,196 KB
testcase_02 AC 78 ms
16,196 KB
testcase_03 AC 77 ms
16,196 KB
testcase_04 AC 82 ms
16,200 KB
testcase_05 AC 105 ms
17,176 KB
testcase_06 AC 208 ms
21,548 KB
testcase_07 AC 345 ms
25,704 KB
testcase_08 AC 207 ms
24,816 KB
testcase_09 AC 195 ms
24,816 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

s = gets.chomp
ans = []
n = s.size
cnt_ok = s.count('o')
cnt_ng = n - cnt_ok
s.chars.each.with_index do |si, i|
  ans << cnt_ok.to_f / (n - i) * 100

  if si == 'o'
    cnt_ok -= 1
  else
    cnt_ng -= 1
  end
end
puts ans
0