結果

問題 No.36 素数が嫌い!
ユーザー maguroguma
提出日時 2017-08-08 18:23:16
言語 Java
(openjdk 23)
結果
RE  
実行時間 -
コード長 549 bytes
コンパイル時間 3,061 ms
コンパイル使用メモリ 74,864 KB
実行使用メモリ 41,864 KB
最終ジャッジ日時 2024-10-12 00:14:04
合計ジャッジ時間 8,395 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 RE * 2
other AC * 13 WA * 1 RE * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class yuki36 {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();

        int divisorCount = 0;
        for(long i=2; i<=Math.pow(N, 0.5); i++){
            if(N%i == 0){
                divisorCount++;
            }
            if(divisorCount==2){
                System.out.println("YES");
                System.exit(1);
            }
        }
        System.out.println("NO");
	}

}
0