結果

問題 No.36 素数が嫌い!
ユーザー magurogumamaguroguma
提出日時 2017-08-08 18:12:03
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 480 bytes
コンパイル時間 1,894 ms
コンパイル使用メモリ 74,548 KB
実行使用メモリ 56,696 KB
最終ジャッジ日時 2024-04-20 05:13:28
合計ジャッジ時間 6,492 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();

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