結果
問題 |
No.312 置換処理
|
ユーザー |
|
提出日時 | 2020-05-17 15:38:44 |
言語 | Rust (1.83.0 + proconio) |
結果 |
WA
|
実行時間 | - |
コード長 | 364 bytes |
コンパイル時間 | 15,008 ms |
コンパイル使用メモリ | 390,364 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-25 07:50:50 |
合計ジャッジ時間 | 16,730 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 44 WA * 1 |
ソースコード
use std::cmp::min; fn main() { let mut n = String::new(); std::io::stdin().read_line(&mut n).ok(); let n: usize = n.trim().parse().unwrap(); let mut result = if n % 2 == 0 { n / 2 } else { n }; for i in 3..=min(result, 1000000) { if n % i == 0 { result = i; break; } } println!("{}", result); }