結果

問題 No.36 素数が嫌い!
ユーザー kano_townkano_town
提出日時 2014-12-12 15:00:29
言語 Java21
(openjdk 21)
結果
AC  
実行時間 348 ms / 5,000 ms
コード長 372 bytes
コンパイル時間 3,289 ms
コンパイル使用メモリ 72,212 KB
実行使用メモリ 56,176 KB
最終ジャッジ日時 2023-09-09 07:05:55
合計ジャッジ時間 10,938 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 228 ms
55,896 KB
testcase_01 AC 300 ms
55,920 KB
testcase_02 AC 124 ms
55,880 KB
testcase_03 AC 125 ms
56,016 KB
testcase_04 AC 123 ms
55,508 KB
testcase_05 AC 125 ms
55,688 KB
testcase_06 AC 126 ms
55,876 KB
testcase_07 AC 126 ms
55,828 KB
testcase_08 AC 123 ms
55,788 KB
testcase_09 AC 123 ms
55,812 KB
testcase_10 AC 125 ms
55,768 KB
testcase_11 AC 196 ms
56,020 KB
testcase_12 AC 337 ms
55,880 KB
testcase_13 AC 339 ms
56,020 KB
testcase_14 AC 259 ms
56,000 KB
testcase_15 AC 125 ms
56,152 KB
testcase_16 AC 125 ms
56,176 KB
testcase_17 AC 122 ms
55,672 KB
testcase_18 AC 123 ms
55,916 KB
testcase_19 AC 210 ms
55,780 KB
testcase_20 AC 348 ms
56,016 KB
testcase_21 AC 288 ms
55,796 KB
testcase_22 AC 293 ms
55,476 KB
testcase_23 AC 228 ms
55,536 KB
testcase_24 AC 246 ms
56,060 KB
testcase_25 AC 235 ms
56,060 KB
testcase_26 AC 256 ms
55,876 KB
testcase_27 AC 307 ms
55,988 KB
testcase_28 AC 251 ms
56,016 KB
testcase_29 AC 329 ms
55,816 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Yukicoder36 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong(), cnt = 0;
		for (long i = 2; i < Math.sqrt(n); i++) {
			if (n % i == 0) cnt++;
			if (n % (i * i) == 0) cnt++;
		}
		if (cnt > 1) System.out.println("YES");
		else System.out.println("NO");
	}
}
0