結果
| 問題 | No.1464 Number Conversion |
| コンテスト | |
| ユーザー |
ixTL255
|
| 提出日時 | 2023-01-14 00:56:14 |
| 言語 | Rust (1.99.0 + proconio + num + itertools + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 0 ms / 2,000 ms |
| + 777µs | |
| コード長 | 358 bytes |
| 記録 | |
| コンパイル時間 | 4,080 ms |
| コンパイル使用メモリ | 183,720 KB |
| 実行使用メモリ | 9,900 KB |
| 最終ジャッジ日時 | 2026-10-07 11:32:27 |
| 合計ジャッジ時間 | 6,441 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)]` (part of `#[warn(unused)]`) 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