結果
| 問題 | No.1113 二つの整数 / Two Integers |
| コンテスト | |
| ユーザー |
Strorkis
|
| 提出日時 | 2020-07-17 21:38:24 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 617 bytes |
| コンパイル時間 | 13,982 ms |
| コンパイル使用メモリ | 379,416 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-29 22:23:04 |
| 合計ジャッジ時間 | 14,824 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 13 WA * 2 |
ソースコード
fn gcd(a: usize, b: usize) -> usize {
let r = a % b;
if r > 0 { gcd(b, r) } else { b }
}
fn main() {
let [a, b]: [usize; 2] = {
let mut buf = String::new();
std::io::stdin().read_line(&mut buf).unwrap();
let mut iter = buf.split_whitespace();
[
iter.next().unwrap().parse().unwrap(),
iter.next().unwrap().parse().unwrap(),
]
};
let c = gcd(a, b);
let d = (c as f32).sqrt() as usize;
if c == (d - 1) * (d - 1) || c == d * d || c == (d + 1) * (d + 1) {
println!("Odd");
} else {
println!("Even");
}
}
Strorkis