結果

問題 No.36 素数が嫌い!
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2016-11-16 05:21:41
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 749 bytes
コンパイル時間 1,919 ms
コンパイル使用メモリ 72,324 KB
実行使用メモリ 58,020 KB
最終ジャッジ日時 2023-08-17 07:19:22
合計ジャッジ時間 7,068 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 116 ms
55,980 KB
testcase_03 AC 118 ms
55,800 KB
testcase_04 AC 120 ms
55,884 KB
testcase_05 AC 119 ms
55,652 KB
testcase_06 AC 119 ms
55,572 KB
testcase_07 AC 117 ms
57,800 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 116 ms
55,720 KB
testcase_12 AC 117 ms
55,764 KB
testcase_13 AC 117 ms
56,096 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 118 ms
55,584 KB
testcase_17 AC 119 ms
56,116 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 117 ms
55,416 KB
testcase_27 AC 116 ms
56,028 KB
testcase_28 AC 117 ms
55,956 KB
testcase_29 AC 117 ms
55,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = 158;//sc.nextLong();
        int c=0;
        if(N%4==0){
            if(N==4){
                System.out.println("NO");
                return;
            }else{
                System.out.println("YES");
                return;
            }
        }else if(N%2==0){
            c=1;
            N/=2;
        }
        long M = (long)Math.sqrt(N);
        for(long i=3;i<=M; i+=2){
            if(N%i==0){
                c++;
            }
            if(c>=3){
                System.out.println("YES");
                return;
            }
        }
        System.out.println("NO");
    }
}
0