結果
問題 | No.312 置換処理 |
ユーザー |
|
提出日時 | 2020-05-17 15:40:38 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 11 ms / 2,000 ms |
コード長 | 373 bytes |
コンパイル時間 | 14,135 ms |
コンパイル使用メモリ | 382,292 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-15 12:35:32 |
合計ジャッジ時間 | 13,890 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 45 |
ソースコード
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 > 4 && n % 2 == 0 { n / 2 } else { n };for i in 3..=min(result, 1000000) {if n % i == 0 {result = i;break;}}println!("{}", result);}