結果

問題 No.91 赤、緑、青の石
ユーザー 👑 obakyan
提出日時 2019-04-14 20:11:51
言語 Lua
(LuaJit 2.1.1734355927)
結果
WA  
実行時間 -
コード長 452 bytes
コンパイル時間 342 ms
コンパイル使用メモリ 6,688 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-19 10:36:37
合計ジャッジ時間 1,228 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 22 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

t = {}
t[1], t[2], t[3] = io.read("*n", "*n", "*n")
table.sort(t)
cnt, a, b = t[1], t[2] - t[1], t[3] - t[1]

plan13 = math.floor((b - a) / 2)
plan13 = math.min(plan13, math.floor(b / 3))
plan13 = math.min(plan13, a)
cnt = cnt + plan13
a = a - plan13
b = b - plan13 * 3

plan44 = math.floor(a / 4)
plan44 = math.min(plan44, b / 4)
cnt = cnt + plan44 * 2
a = a - plan44 * 4
b = b - plan44 * 4

if(1 <= a and 3 <= b) then
    cnt = cnt + 1
end
print(cnt)
0