結果

問題 No.667 Mice's Luck(ネズミ達の運)
コンテスト
ユーザー cs027983
提出日時 2018-03-24 03:56:43
言語 Ruby
(4.0.1)
コンパイル:
ruby -w -c _filename_
実行:
ruby _filename_
結果
AC  
実行時間 228 ms / 2,000 ms
コード長 316 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 57 ms
コンパイル使用メモリ 9,216 KB
実行使用メモリ 23,168 KB
最終ジャッジ日時 2026-03-11 07:12:53
合計ジャッジ時間 1,782 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #
raw source code

places = gets.to_s.chomp!.split('')
number_of_rats = places.size.to_f
number_of_correct_answers = places.select { |p| p if p == 'o' }.size.to_f

places.each do |place|
  puts sprintf('%.13f', number_of_correct_answers / number_of_rats * 100)
  number_of_correct_answers -= 1 if place == 'o'
  number_of_rats -= 1
end
0