結果

問題 No.36 素数が嫌い!
ユーザー magurogumamaguroguma
提出日時 2017-08-08 18:25:36
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 617 bytes
コンパイル時間 3,098 ms
コンパイル使用メモリ 74,204 KB
実行使用メモリ 41,924 KB
最終ジャッジ日時 2024-04-20 05:14:30
合計ジャッジ時間 7,903 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 107 ms
40,592 KB
testcase_01 AC 113 ms
40,500 KB
testcase_02 AC 103 ms
40,464 KB
testcase_03 AC 112 ms
41,188 KB
testcase_04 AC 100 ms
40,444 KB
testcase_05 AC 109 ms
41,212 KB
testcase_06 AC 113 ms
41,280 KB
testcase_07 AC 102 ms
40,316 KB
testcase_08 AC 110 ms
41,288 KB
testcase_09 AC 101 ms
40,208 KB
testcase_10 AC 97 ms
40,064 KB
testcase_11 AC 141 ms
40,316 KB
testcase_12 AC 206 ms
40,012 KB
testcase_13 AC 230 ms
41,316 KB
testcase_14 WA -
testcase_15 AC 114 ms
41,676 KB
testcase_16 AC 113 ms
41,276 KB
testcase_17 AC 111 ms
41,244 KB
testcase_18 AC 110 ms
41,384 KB
testcase_19 AC 99 ms
40,056 KB
testcase_20 AC 126 ms
41,924 KB
testcase_21 AC 103 ms
40,308 KB
testcase_22 AC 103 ms
40,076 KB
testcase_23 AC 109 ms
41,328 KB
testcase_24 AC 142 ms
41,404 KB
testcase_25 AC 103 ms
40,460 KB
testcase_26 AC 169 ms
40,516 KB
testcase_27 AC 197 ms
40,608 KB
testcase_28 AC 180 ms
41,244 KB
testcase_29 AC 202 ms
40,384 KB
権限があれば一括ダウンロードができます

ソースコード

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();
        boolean flag = true;

        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");
                flag = false;
                break;
            }
        }
        if(flag)
        	System.out.println("NO");
	}

}
0