結果

問題 No.1611 Minimum Multiple with Double Divisors
ユーザー phspls
提出日時 2022-10-24 12:16:21
言語 Rust
(1.83.0 + proconio)
結果
WA  
実行時間 -
コード長 554 bytes
コンパイル時間 16,433 ms
コンパイル使用メモリ 385,816 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-02 15:23:18
合計ジャッジ時間 18,779 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 9 WA * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

fn solve() -> usize {
    let mut x = String::new();
    std::io::stdin().read_line(&mut x).ok();
    let x: usize = x.trim().parse().unwrap();
    for i in 2.. {
        if x / i * i != x && x % i > 0 {
            return i * x;
        }
    }
    0
}

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 = Vec::with_capacity(n);
    for _ in 0..n {
        result.push(solve());
    }
    for &v in result.iter() {
        println!("{}", v);
    }
}
0