結果
問題 | No.1224 I hate Sqrt Inequality |
ユーザー |
![]() |
提出日時 | 2022-12-22 20:04:08 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 537 bytes |
コンパイル時間 | 10,354 ms |
コンパイル使用メモリ | 382,640 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-18 03:25:58 |
合計ジャッジ時間 | 11,120 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 13 |
ソースコード
const fn gcd(a: u64, b: u64) -> u64 { let mut x = (a, b); while x.1 > 0 { x = (x.1, x.0 % x.1); } x.0 } fn main() { let mut xx = String::new(); std::io::stdin().read_line(&mut xx).ok(); let xx: Vec<u64> = xx.split_whitespace().flat_map(str::parse).collect(); let gcd = gcd(xx[0], xx[1]); let mut b = xx[1] / gcd; while b % 2 == 0 { b /= 2; } while b % 5 == 0 { b /= 5; } if b == 1 { println!("No"); } else { println!("Yes"); } }