結果

問題 No.35 タイパー高橋
コンテスト
ユーザー obakyan
提出日時 2019-04-02 16:51:07
言語 Lua
(LuaJit 2.1.1791890110)
コンパイル:
luajit -b _filename_ a.out
実行:
luajit _filename_
結果
AC  
実行時間 1 ms / 5,000 ms
+ 877µs
コード長 292 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 104 ms
コンパイル使用メモリ 7,852 KB
実行使用メモリ 9,832 KB
最終ジャッジ日時 2026-10-11 05:11:06
合計ジャッジ時間 866 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 5
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

n = io.read("*n", "*l")
ok, ng = 0, 0
for i = 1, n do
    a = io.read()
    d, w = string.match(a, "(%d+) (%w+)")
    d = tonumber(d)
    wlen = string.len(w)
    cap = math.min(wlen, math.floor(d * 3 / 250))
    ok, ng = ok + cap, ng + wlen - cap
end
io.write(string.format("%d %d", ok, ng))
0