結果

問題 No.136 Yet Another GCD Problem
ユーザー phspls
提出日時 2020-05-23 19:30:45
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 345 bytes
コンパイル時間 12,010 ms
コンパイル使用メモリ 399,736 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-08 20:20:56
合計ジャッジ時間 13,618 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 39
権限があれば一括ダウンロードができます

ソースコード

diff #

fn main() {
    let mut nk = String::new();
    std::io::stdin().read_line(&mut nk).ok();
    let nk: Vec<usize> = nk.trim().split_whitespace().map(|s| s.parse().unwrap()).collect();
    let n = nk[0];

    for i in 2..=n/2 {
        if n % i == 0 {
            println!("{}", n / i);
            return;
        }
    }
    println!("{}", 1);
}
0