結果
| 問題 | No.1423 Triangle of Multiples |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-03-14 09:51:51 |
| 言語 | Lua (LuaJit 2.1.1734355927) |
| 結果 |
AC
|
| 実行時間 | 123 ms / 2,000 ms |
| コード長 | 617 bytes |
| 記録 | |
| コンパイル時間 | 229 ms |
| コンパイル使用メモリ | 6,816 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-15 19:42:08 |
| 合計ジャッジ時間 | 1,424 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 4 |
ソースコード
local q = io.read("*n")
for iq = 1, q do
local a, b, c = io.read("*n", "*n", "*n")
local ta, tb, tc = 1LL * a, 1LL * b, 1LL * c
while true do
if ta + tb <= tc then
if ta < tb then ta = ta + ta
else tb = tb + tb
end
elseif tb + tc <= ta then
if tb < tc then tb = tb + tb
else tc = tc + tc
end
elseif tc + ta <= tb then
if tc < ta then tc = tc + tc
else ta = ta + ta
end
else
break
end
end
a = tostring(ta):gsub("LL", "")
b = tostring(tb):gsub("LL", "")
c = tostring(tc):gsub("LL", "")
print(a .. " " .. b .. " " .. c)
end