結果

問題 No.36 素数が嫌い!
ユーザー Daigo HIROOKADaigo HIROOKA
提出日時 2018-05-19 00:41:56
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 412 bytes
コンパイル時間 3,463 ms
コンパイル使用メモリ 72,768 KB
実行使用メモリ 56,284 KB
最終ジャッジ日時 2023-09-10 23:31:52
合計ジャッジ時間 9,298 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 161 ms
55,424 KB
testcase_01 AC 140 ms
55,420 KB
testcase_02 AC 130 ms
55,848 KB
testcase_03 AC 127 ms
55,748 KB
testcase_04 AC 133 ms
55,808 KB
testcase_05 AC 129 ms
55,656 KB
testcase_06 AC 129 ms
55,376 KB
testcase_07 AC 131 ms
55,420 KB
testcase_08 AC 132 ms
55,552 KB
testcase_09 AC 128 ms
55,648 KB
testcase_10 AC 127 ms
55,660 KB
testcase_11 AC 172 ms
55,716 KB
testcase_12 AC 250 ms
55,876 KB
testcase_13 AC 251 ms
55,704 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 130 ms
55,676 KB
testcase_17 AC 126 ms
55,624 KB
testcase_18 AC 130 ms
55,804 KB
testcase_19 AC 138 ms
55,540 KB
testcase_20 AC 137 ms
56,284 KB
testcase_21 AC 148 ms
55,784 KB
testcase_22 AC 135 ms
55,744 KB
testcase_23 AC 132 ms
56,184 KB
testcase_24 AC 151 ms
55,552 KB
testcase_25 AC 158 ms
55,588 KB
testcase_26 AC 172 ms
55,428 KB
testcase_27 AC 133 ms
55,560 KB
testcase_28 AC 176 ms
55,436 KB
testcase_29 AC 134 ms
55,452 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 p = 2;
		int num_prime_factor = 0;
		for(int i = 2; i < Math.sqrt(N); i++){
			if(N%p == 0){
				N /= p;
				num_prime_factor++;
			}
			else p++;
		}
		
		if(num_prime_factor >= 2) System.out.println("YES");
		else System.out.println("NO");
		
	}
}
0