結果
問題 | No.356 円周上を回る3つの動点の一致 |
ユーザー |
👑 |
提出日時 | 2019-09-17 15:35:04 |
言語 | Lua (LuaJit 2.1.1734355927) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 401 bytes |
コンパイル時間 | 93 ms |
コンパイル使用メモリ | 6,688 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-13 21:12:59 |
合計ジャッジ時間 | 1,318 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 48 |
ソースコード
local function getgcd(x, y) while 0 < x do x, y = y % x, x end return y end local t1, t2, t3 = io.read("*n", "*n", "*n") local a1 = t1 * (t3 - t2) local a2 = t3 * (t2 - t1) local gcd_a = getgcd(a1, a2) local mul = math.floor(a2 / gcd_a) local b1 = mul * t1 * t2 local b2 = t2 - t1 local gcd_b = getgcd(b1, b2) b1 = math.floor(b1 / gcd_b) b2 = math.floor(b2 / gcd_b) print(b1 .. "/" .. b2)