結果

問題 No.36 素数が嫌い!
ユーザー cra77756176
提出日時 2022-12-21 21:56:19
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 84 ms / 5,000 ms
コード長 451 bytes
コンパイル時間 12,622 ms
コンパイル使用メモリ 390,988 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-18 02:59:49
合計ジャッジ時間 11,453 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

fn main() {
    let mut n = String::new();
    std::io::stdin().read_line(&mut n).ok();
    let mut n: u64 = n.trim().parse().unwrap();

    let mut count = 0;
    for i in 2.. {
        if i * i > n {
            break;
        }
        while n % i == 0 {
            n /= i;
            count += 1;
        }
    }

    if n > 1 {
        count += 1;
    }

    if count >= 3 {
        println!("YES");
    } else {
        println!("NO");
    }
}
0