結果
| 問題 |
No.816 Beautiful tuples
|
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2019-04-20 00:18:09 |
| 言語 | Lua (LuaJit 2.1.1734355927) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 453 bytes |
| コンパイル時間 | 288 ms |
| コンパイル使用メモリ | 6,948 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-24 08:20:06 |
| 合計ジャッジ時間 | 898 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 WA * 4 |
ソースコード
local a, b = io.read("*n", "*n")
-- (1, 2, 5), (1, 3, 3), (2, 2, 2)
local t1 = {1, 1, 2, 2, 5, 5, 1, 3, 3, 2}
local t2 = {2, 5, 1, 5, 1, 2, 3, 1, 3, 2}
local t3 = {5, 2, 5, 1, 2, 1, 3, 3, 1, 2}
local ccand = -1
for i = 1, 10 do
if((a + b) % t1[i] == 0) then
local c = (a + b) / t1[i]
if((b + c) == t2[i] * a and (c + a) == t3[i] * b) then
if(ccand == -1) then ccand = c else ccand = math.min(ccand, c) end
end
end
end
print(ccand)