結果

問題 No.667 Mice's Luck(ネズミ達の運)
ユーザー nobigomunobigomu
提出日時 2018-04-27 18:03:09
言語 Lua
(LuaJit 2.1.1696795921)
結果
AC  
実行時間 139 ms / 2,000 ms
コード長 261 bytes
コンパイル時間 344 ms
コンパイル使用メモリ 5,312 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-10 06:14:20
合計ジャッジ時間 1,910 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,384 KB
testcase_02 AC 1 ms
4,384 KB
testcase_03 AC 1 ms
4,384 KB
testcase_04 AC 3 ms
4,380 KB
testcase_05 AC 15 ms
4,384 KB
testcase_06 AC 70 ms
4,380 KB
testcase_07 AC 139 ms
4,380 KB
testcase_08 AC 71 ms
4,380 KB
testcase_09 AC 60 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

(function (f, s)
	local n,d,t = f(s,"o"),#s,"%.13f\n"
	for i=1,#s do io.write(t:format(n/d*100)) if s:sub(i,i)=="o" then n=n-1 end d=d-1 end
end)(function (s, c)
	local r = 0
	for i=1,#s do if s:sub(i,i)==c then r=r+1 end end
	return r
end, io.stdin:read("*l"))
0