結果

問題 No.667 Mice's Luck(ネズミ達の運)
ユーザー simansiman
提出日時 2021-07-02 18:42:02
言語 Ruby
(3.3.0)
結果
AC  
実行時間 418 ms / 2,000 ms
コード長 183 bytes
コンパイル時間 361 ms
コンパイル使用メモリ 11,516 KB
実行使用メモリ 15,664 KB
最終ジャッジ日時 2023-09-11 12:33:29
合計ジャッジ時間 5,263 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
15,244 KB
testcase_01 AC 79 ms
15,312 KB
testcase_02 AC 79 ms
15,220 KB
testcase_03 AC 79 ms
15,272 KB
testcase_04 AC 84 ms
15,068 KB
testcase_05 AC 114 ms
15,368 KB
testcase_06 AC 250 ms
15,252 KB
testcase_07 AC 418 ms
15,664 KB
testcase_08 AC 243 ms
15,552 KB
testcase_09 AC 232 ms
15,356 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

S = gets.chomp

ok = S.count('o')
ng = S.count('x')
n = S.size

S.each_char do |s|
  puts Rational(100 * ok, n).to_f

  if s == 'o'
    ok -= 1
  else
    ng -= 1
  end

  n -= 1
end
0