結果

問題 No.36 素数が嫌い!
ユーザー chiho_miyakochiho_miyako
提出日時 2015-04-13 17:36:54
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 628 bytes
コンパイル時間 1,985 ms
コンパイル使用メモリ 71,604 KB
実行使用メモリ 56,272 KB
最終ジャッジ日時 2023-09-17 19:59:24
合計ジャッジ時間 9,275 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner koko = new Scanner(System.in);
        long n = koko.nextInt();
        int a=0;
        for(int i=2; i<n; i++){
            if(a==1){
                break;
            }else if(n%i==0){
                for(int j=2; j<i; j++){
                    if(i%j==0){
                        a=1;
                        System.out.println("YES");
                        break;
                    }
                }
            }
        }
        if(a==0){
            System.out.println("NO");
        }
    }
}
0