結果
問題 | No.91 赤、緑、青の石 |
ユーザー |
👑 |
提出日時 | 2019-04-14 20:23:51 |
言語 | Lua (LuaJit 2.1.1734355927) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 598 bytes |
コンパイル時間 | 168 ms |
コンパイル使用メモリ | 6,940 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-24 07:19:15 |
合計ジャッジ時間 | 1,184 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 28 |
ソースコード
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 + plan13a = a - plan13b = b - plan13 * 3plan44 = math.floor(a / 4)plan44 = math.min(plan44, b / 4)cnt = cnt + plan44 * 2a = a - plan44 * 4b = b - plan44 * 4cand = 0if(a == 3) thencand = 1 + math.floor((b - 1) / 5)endplan13 = math.min(a, math.floor(b / 3))plan05 = math.floor((b - plan13 * 3) / 5)cnt = cnt + math.max(cand, plan13 + plan05)print(cnt)