結果
| 問題 | 
                            No.36 素数が嫌い!
                             | 
                    
| コンテスト | |
| ユーザー | 
                             Maricom_tkg
                         | 
                    
| 提出日時 | 2018-11-16 18:56:29 | 
| 言語 | Rust  (1.83.0 + proconio)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 150 ms / 5,000 ms | 
| コード長 | 571 bytes | 
| コンパイル時間 | 15,306 ms | 
| コンパイル使用メモリ | 377,660 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-12-24 14:13:07 | 
| 合計ジャッジ時間 | 16,056 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 26 | 
ソースコード
use std::io::Read;
fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();
    
    let mut n: u64 = buf.trim().parse().unwrap();
    
    let limit: u64 = (n as f64).sqrt() as u64;
    let mut prime_count: usize = 0;
    let mut num: u64 = 2;
    while num <= limit && n > 1 {
        if prime_count >= 2 {
            println!("YES");
            return;
        }
        if n % num == 0 {
            n /= num;
            prime_count += 1;
        } else {
            num += 1;
        }
    }
    
    println!("NO")
}
            
            
            
        
            
Maricom_tkg