結果
| 問題 |
No.662 スロットマシーン
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-04-30 11:41:53 |
| 言語 | Lua (LuaJit 2.1.1734355927) |
| 結果 |
AC
|
| 実行時間 | 4 ms / 2,000 ms |
| コード長 | 668 bytes |
| コンパイル時間 | 235 ms |
| コンパイル使用メモリ | 6,820 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-12-29 14:14:45 |
| 合計ジャッジ時間 | 1,248 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 |
ソースコード
local ior = io.input()
local dic = {}
local score = {}
local cnt = {}
local len = {}
local str = ""
for i = 1, 3 do cnt[i] = {} end
for i = 1, 5 do
str = ior:read()
local name = str:match("%w+")
local num = tonumber(str:match("%d+"))
dic[name] = i
score[i] = num
for j = 1, 3 do cnt[j][i] = 0 end
end
for i = 1, 3 do
len[i] = ior:read("*n", "*l")
for j = 1, len[i] do
str = ior:read()
cnt[i][dic[str]] = cnt[i][dic[str]] + 1
end
end
local c = {}
local e = 0
for i = 1, 5 do
c[i] = 5 * cnt[1][i] * cnt[2][i] * cnt[3][i]
e = e + c[i] * score[i] / len[1] / len[2] / len[3]
end
print(string.format("%.8f", e))
for i = 1, 5 do print(c[i]) end