結果
| 問題 | No.1113 二つの整数 / Two Integers |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-07-17 22:13:09 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 543 bytes |
| 記録 | |
| コンパイル時間 | 12,991 ms |
| コンパイル使用メモリ | 378,900 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-30 00:29:50 |
| 合計ジャッジ時間 | 14,003 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 9 WA * 6 |
コンパイルメッセージ
warning: unused import: `std::cmp::*` --> src/main.rs:1:5 | 1 | use std::cmp::*; | ^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default
ソースコード
use std::cmp::*;
use std::io::*;
fn gcd(a: u64, b: u64) -> u64 {
if b == 0 {
return a;
}
gcd(b, a % b)
}
fn main() {
let mut s: String = String::new();
std::io::stdin().read_to_string(&mut s).ok();
let mut itr = s.trim().split_whitespace();
let a: u64 = itr.next().unwrap().parse().unwrap();
let b: u64 = itr.next().unwrap().parse().unwrap();
let g = gcd(a, b);
let h = ((g as f64).sqrt() + 0.5) as u64;
if g == h {
println!("Odd");
} else {
println!("Even");
}
}