結果
問題 | No.667 Mice's Luck(ネズミ達の運) |
ユーザー |
👑 |
提出日時 | 2019-04-20 12:55:41 |
言語 | Lua (LuaJit 2.1.1734355927) |
結果 |
AC
|
実行時間 | 41 ms / 2,000 ms |
コード長 | 265 bytes |
コンパイル時間 | 196 ms |
コンパイル使用メモリ | 6,944 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-25 11:03:00 |
合計ジャッジ時間 | 2,606 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
local str = io.read()local count = {}local n = #strcount[n + 1] = 0for i = n, 1, -1 dolocal a = string.sub(str, i, i)count[i] = count[i + 1] + (a == "o" and 1 or 0)endfor i = 1, n doio.write(string.format("%.8f\n", 100 * count[i] / (n + 1 - i)))end