結果
問題 |
No.1224 I hate Sqrt Inequality
|
ユーザー |
👑 |
提出日時 | 2020-09-19 19:59:54 |
言語 | Lua (LuaJit 2.1.1734355927) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 408 bytes |
コンパイル時間 | 28 ms |
コンパイル使用メモリ | 6,688 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-23 18:15:49 |
合計ジャッジ時間 | 642 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 13 |
ソースコード
local ffi = require("ffi") local C = ffi.C ffi.cdef[[ long long atoll(const char*); ]] local function getgcd(x, y) while 0LL < x do x, y = y % x, x end return y end s = io.read() a, b = s:match("(%d+) (%d+)") a = C.atoll(a) b = C.atoll(b) gcd = getgcd(a, b) a = a / gcd b = b / gcd while b % 2LL == 0 do b = b / 2LL end while b % 5LL == 0 do b = b / 5LL end print(b == 1LL and "No" or "Yes")