結果
| 問題 |
No.1464 Number Conversion
|
| コンテスト | |
| ユーザー |
ixTL255
|
| 提出日時 | 2023-01-14 00:56:14 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 358 bytes |
| コンパイル時間 | 18,773 ms |
| コンパイル使用メモリ | 375,996 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-24 20:57:13 |
| 合計ジャッジ時間 | 18,347 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 29 |
コンパイルメッセージ
warning: variable does not need to be mutable --> src/main.rs:9:9 | 9 | let mut x: f64 = x.trim().parse().unwrap(); | ----^ | | | help: remove this `mut` | = note: `#[warn(unused_mut)]` on by default warning: variable does not need to be mutable --> src/main.rs:10:9 | 10 | let mut a = (x * 100_000_000.).round() as i64; | ----^ | | | help: remove this `mut` warning: variable does not need to be mutable --> src/main.rs:11:9 | 11 | let mut b = 100_000_000; | ----^ | | | help: remove this `mut`
ソースコード
fn gcd(a: i64, b: i64) -> i64 {
if b == 0 { return a; }
gcd(b, a % b)
}
fn main() {
let mut x = String::new();
std::io::stdin().read_line(&mut x).ok();
let mut x: f64 = x.trim().parse().unwrap();
let mut a = (x * 100_000_000.).round() as i64;
let mut b = 100_000_000;
let g = gcd(a, b);
println!("{}/{}", a / g, b / g);
}
ixTL255