結果

問題 No.36 素数が嫌い!
ユーザー magurogumamaguroguma
提出日時 2017-08-08 18:23:16
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 549 bytes
コンパイル時間 3,531 ms
コンパイル使用メモリ 74,416 KB
実行使用メモリ 41,904 KB
最終ジャッジ日時 2024-04-20 05:14:14
合計ジャッジ時間 9,553 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 AC 142 ms
41,264 KB
testcase_03 AC 129 ms
41,068 KB
testcase_04 AC 134 ms
41,236 KB
testcase_05 AC 128 ms
41,212 KB
testcase_06 AC 135 ms
41,220 KB
testcase_07 AC 139 ms
41,340 KB
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 AC 169 ms
41,516 KB
testcase_12 AC 238 ms
40,240 KB
testcase_13 AC 246 ms
41,316 KB
testcase_14 WA -
testcase_15 RE -
testcase_16 AC 136 ms
41,192 KB
testcase_17 AC 134 ms
41,040 KB
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 AC 185 ms
41,404 KB
testcase_27 AC 234 ms
41,284 KB
testcase_28 AC 196 ms
40,444 KB
testcase_29 AC 241 ms
41,632 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();

        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