結果

問題 No.36 素数が嫌い!
ユーザー chiho_miyakochiho_miyako
提出日時 2015-04-14 18:14:39
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 709 bytes
コンパイル時間 4,049 ms
コンパイル使用メモリ 71,236 KB
実行使用メモリ 57,936 KB
最終ジャッジ日時 2023-09-17 20:16:59
合計ジャッジ時間 28,310 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 AC 123 ms
55,688 KB
testcase_03 AC 121 ms
55,636 KB
testcase_04 AC 122 ms
55,736 KB
testcase_05 AC 4,475 ms
56,100 KB
testcase_06 AC 4,048 ms
55,776 KB
testcase_07 AC 3,604 ms
55,944 KB
testcase_08 AC 966 ms
55,420 KB
testcase_09 AC 4,032 ms
56,156 KB
testcase_10 AC 2,646 ms
55,984 KB
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 AC 123 ms
55,804 KB
testcase_16 AC 123 ms
57,888 KB
testcase_17 AC 125 ms
55,420 KB
testcase_18 AC 251 ms
55,940 KB
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.*;

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