結果
問題 |
No.667 Mice's Luck(ネズミ達の運)
|
ユーザー |
|
提出日時 | 2018-03-24 03:27:20 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 326 ms / 2,000 ms |
コード長 | 404 bytes |
コンパイル時間 | 222 ms |
コンパイル使用メモリ | 7,552 KB |
実行使用メモリ | 22,016 KB |
最終ジャッジ日時 | 2024-06-25 02:40:58 |
合計ジャッジ時間 | 2,693 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
コンパイルメッセージ
Syntax OK
ソースコード
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 |a| if a == 'o' puts sprintf('%.13f', number_of_correct_answers / number_of_rats * 100) number_of_correct_answers -= 1 else puts sprintf('%.13f', number_of_correct_answers / number_of_rats * 100) end number_of_rats -= 1 end