結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
41,376 KB
testcase_01 AC 121 ms
41,212 KB
testcase_02 AC 134 ms
41,232 KB
testcase_03 AC 136 ms
41,216 KB
testcase_04 AC 126 ms
41,204 KB
testcase_05 AC 138 ms
41,052 KB
testcase_06 AC 130 ms
41,460 KB
testcase_07 AC 136 ms
41,488 KB
testcase_08 AC 125 ms
41,380 KB
testcase_09 AC 136 ms
41,808 KB
testcase_10 AC 127 ms
40,984 KB
testcase_11 AC 165 ms
41,792 KB
testcase_12 AC 238 ms
41,548 KB
testcase_13 AC 235 ms
41,244 KB
testcase_14 WA -
testcase_15 AC 126 ms
41,044 KB
testcase_16 AC 130 ms
41,280 KB
testcase_17 AC 133 ms
41,200 KB
testcase_18 AC 121 ms
41,376 KB
testcase_19 AC 140 ms
41,332 KB
testcase_20 AC 145 ms
41,204 KB
testcase_21 AC 123 ms
41,480 KB
testcase_22 AC 130 ms
41,460 KB
testcase_23 AC 135 ms
41,196 KB
testcase_24 AC 150 ms
41,088 KB
testcase_25 AC 139 ms
41,232 KB
testcase_26 AC 214 ms
40,928 KB
testcase_27 AC 225 ms
40,864 KB
testcase_28 AC 195 ms
41,216 KB
testcase_29 AC 249 ms
41,428 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*i<=N; i++){
            if(N%i == 0){
                divisorCount++;
            }
            if(divisorCount==2){
                System.out.println("YES");
                flag = false;
                break;
            }
        }
        if(flag)
        	System.out.println("NO");
	}

}
0