結果

問題 No.36 素数が嫌い!
ユーザー Daigo HIROOKADaigo HIROOKA
提出日時 2018-05-19 00:48:08
言語 Java21
(openjdk 21)
結果
AC  
実行時間 236 ms / 5,000 ms
コード長 387 bytes
コンパイル時間 4,027 ms
コンパイル使用メモリ 71,896 KB
実行使用メモリ 57,388 KB
最終ジャッジ日時 2023-09-10 23:32:22
合計ジャッジ時間 9,874 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 153 ms
55,848 KB
testcase_01 AC 131 ms
55,732 KB
testcase_02 AC 124 ms
55,912 KB
testcase_03 AC 122 ms
56,028 KB
testcase_04 AC 125 ms
56,236 KB
testcase_05 AC 124 ms
55,676 KB
testcase_06 AC 125 ms
55,540 KB
testcase_07 AC 125 ms
55,552 KB
testcase_08 AC 124 ms
55,616 KB
testcase_09 AC 123 ms
56,392 KB
testcase_10 AC 126 ms
55,804 KB
testcase_11 AC 163 ms
55,640 KB
testcase_12 AC 236 ms
55,736 KB
testcase_13 AC 236 ms
55,560 KB
testcase_14 AC 125 ms
55,844 KB
testcase_15 AC 123 ms
55,612 KB
testcase_16 AC 123 ms
55,580 KB
testcase_17 AC 123 ms
57,388 KB
testcase_18 AC 122 ms
55,976 KB
testcase_19 AC 133 ms
55,656 KB
testcase_20 AC 131 ms
55,844 KB
testcase_21 AC 142 ms
55,704 KB
testcase_22 AC 129 ms
55,900 KB
testcase_23 AC 126 ms
55,396 KB
testcase_24 AC 144 ms
55,680 KB
testcase_25 AC 147 ms
55,844 KB
testcase_26 AC 167 ms
55,868 KB
testcase_27 AC 130 ms
53,608 KB
testcase_28 AC 167 ms
55,952 KB
testcase_29 AC 130 ms
55,656 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No036{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();

		int num_prime_factor = 0;
		for(int p = 2; p < Math.sqrt(N); p++){
			while(N%p == 0){
				N /= p;
				num_prime_factor++;
			}
		}
		
		if(num_prime_factor >= 2) System.out.println("YES");
		else System.out.println("NO");
		
	}
}
0