結果
| 問題 | No.25 有限小数 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-12-24 09:22:38 |
| 言語 | Rust (1.99.0 + proconio + num + itertools + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 576 bytes |
| 記録 | |
| コンパイル時間 | 14,910 ms |
| コンパイル使用メモリ | 186,856 KB |
| 実行使用メモリ | 9,780 KB |
| 最終ジャッジ日時 | 2026-08-31 08:24:57 |
| 合計ジャッジ時間 | 2,856 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_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");
}