結果

問題 No.3159 Just Answer 10 Integers!
ユーザー urectanc
提出日時 2025-05-23 20:31:41
言語 Rust
(1.83.0 + proconio)
結果
WA  
実行時間 -
コード長 442 bytes
コンパイル時間 10,942 ms
コンパイル使用メモリ 401,908 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-05-23 20:32:10
合計ジャッジ時間 12,301 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 3 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

use proconio::input;

fn main() {
    input! {
        n: usize
    }

    let lcm = if n < 4 {
        6
    } else if n < 8 {
        30
    } else {
        210
    };

    let ans = (2..=lcm)
        .rev()
        .filter(|&x| lcm % x == 0)
        .take(n)
        .collect::<Vec<_>>();

    let output = ans
        .iter()
        .map(|x| x.to_string())
        .collect::<Vec<_>>()
        .join(" ");
    println!("{}", output);
}
0