結果
| 問題 | No.25 有限小数 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-12-24 09:22:38 |
| 言語 | Rust (1.94.0 + proconio + num + itertools) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 576 bytes |
| 記録 | |
| コンパイル時間 | 898 ms |
| コンパイル使用メモリ | 194,324 KB |
| 実行使用メモリ | 7,976 KB |
| 最終ジャッジ日時 | 2026-04-08 08:54:27 |
| 合計ジャッジ時間 | 2,101 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 24 WA * 7 |
ソースコード
use std::io::Read;
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 n: u128 = itr.next().unwrap().parse().unwrap();
let m: u128 = itr.next().unwrap().parse().unwrap();
for i in 0..18 {
let num: u128 = n * 10u128.pow(i);
if num % m == 0 {
let mut ans = num / m;
while ans % 10 == 0 {
ans /= 10;
}
println!("{}", ans % 10);
return;
}
}
println!("-1");
}