結果
問題 |
No.667 Mice's Luck(ネズミ達の運)
|
ユーザー |
|
提出日時 | 2018-03-24 03:56:43 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 320 ms / 2,000 ms |
コード長 | 316 bytes |
コンパイル時間 | 66 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 21,888 KB |
最終ジャッジ日時 | 2024-06-25 02:41:01 |
合計ジャッジ時間 | 2,630 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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 |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