結果

問題 No.36 素数が嫌い!
ユーザー samplelpmassamplelpmas
提出日時 2017-01-30 18:54:57
言語 Java21
(openjdk 21)
結果
AC  
実行時間 345 ms / 5,000 ms
コード長 469 bytes
コンパイル時間 2,327 ms
コンパイル使用メモリ 71,388 KB
実行使用メモリ 56,564 KB
最終ジャッジ日時 2023-09-09 07:47:53
合計ジャッジ時間 9,662 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 223 ms
55,968 KB
testcase_01 AC 298 ms
55,404 KB
testcase_02 AC 122 ms
55,780 KB
testcase_03 AC 120 ms
53,452 KB
testcase_04 AC 122 ms
55,852 KB
testcase_05 AC 122 ms
55,756 KB
testcase_06 AC 125 ms
55,932 KB
testcase_07 AC 127 ms
55,812 KB
testcase_08 AC 123 ms
55,984 KB
testcase_09 AC 124 ms
55,800 KB
testcase_10 AC 124 ms
55,772 KB
testcase_11 AC 197 ms
55,676 KB
testcase_12 AC 336 ms
55,776 KB
testcase_13 AC 337 ms
56,564 KB
testcase_14 AC 260 ms
56,244 KB
testcase_15 AC 123 ms
55,956 KB
testcase_16 AC 123 ms
55,760 KB
testcase_17 AC 121 ms
55,792 KB
testcase_18 AC 122 ms
55,944 KB
testcase_19 AC 209 ms
56,024 KB
testcase_20 AC 345 ms
56,144 KB
testcase_21 AC 286 ms
55,684 KB
testcase_22 AC 293 ms
55,864 KB
testcase_23 AC 228 ms
56,044 KB
testcase_24 AC 244 ms
55,808 KB
testcase_25 AC 239 ms
56,052 KB
testcase_26 AC 258 ms
55,900 KB
testcase_27 AC 307 ms
55,596 KB
testcase_28 AC 251 ms
55,896 KB
testcase_29 AC 331 ms
55,996 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        long N = sc.nextLong();

        int count = 0;

        for (long i = 2; i < Math.sqrt(N); i++) {

            if (N % i == 0) {
                count++;
            }

            if (N % (i * i) == 0) {
                count++;
            }

        }

        System.out.println(1 < count ? "YES" : "NO");

    }

}
0