結果

問題 No.36 素数が嫌い!
ユーザー kohaku_kohaku
提出日時 2016-11-16 05:21:41
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 749 bytes
コンパイル時間 2,504 ms
コンパイル使用メモリ 74,420 KB
実行使用メモリ 41,608 KB
最終ジャッジ日時 2024-11-26 02:07:54
合計ジャッジ時間 6,417 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 2
other AC * 13 WA * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = 158;//sc.nextLong();
        int c=0;
        if(N%4==0){
            if(N==4){
                System.out.println("NO");
                return;
            }else{
                System.out.println("YES");
                return;
            }
        }else if(N%2==0){
            c=1;
            N/=2;
        }
        long M = (long)Math.sqrt(N);
        for(long i=3;i<=M; i+=2){
            if(N%i==0){
                c++;
            }
            if(c>=3){
                System.out.println("YES");
                return;
            }
        }
        System.out.println("NO");
    }
}
0