結果
問題 | No.36 素数が嫌い! |
ユーザー |
![]() |
提出日時 | 2016-01-29 15:59:08 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 167 ms / 5,000 ms |
コード長 | 657 bytes |
コンパイル時間 | 1,952 ms |
コンパイル使用メモリ | 73,516 KB |
実行使用メモリ | 37,908 KB |
最終ジャッジ日時 | 2024-06-27 00:39:49 |
合計ジャッジ時間 | 4,965 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 26 |
ソースコード
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) { BufferedReader stdReader =new BufferedReader(new InputStreamReader(System.in)); try { long num = Long.parseLong(stdReader.readLine()); int count = 0; for(long i=2;i*i<num+1;i++){ while(num%i==0){ num /= i; count++; } } if(num>1) count++; if(count >= 3) System.out.println("YES"); else System.out.println("NO"); } catch (IOException e) { e.printStackTrace(); } } }