結果

問題 No.36 素数が嫌い!
ユーザー nCk_cvnCk_cv
提出日時 2016-02-05 13:54:19
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 507 bytes
コンパイル時間 2,279 ms
コンパイル使用メモリ 74,876 KB
実行使用メモリ 57,640 KB
最終ジャッジ日時 2023-10-21 19:16:48
合計ジャッジ時間 8,579 ms
ジャッジサーバーID
(参考情報)
judge9 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 189 ms
57,412 KB
testcase_01 AC 230 ms
57,376 KB
testcase_02 AC 131 ms
57,356 KB
testcase_03 WA -
testcase_04 AC 131 ms
57,336 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 135 ms
57,476 KB
testcase_08 AC 134 ms
57,392 KB
testcase_09 AC 135 ms
57,452 KB
testcase_10 AC 133 ms
57,428 KB
testcase_11 AC 173 ms
57,128 KB
testcase_12 AC 248 ms
57,464 KB
testcase_13 AC 245 ms
57,504 KB
testcase_14 AC 205 ms
57,568 KB
testcase_15 AC 134 ms
57,400 KB
testcase_16 AC 134 ms
57,632 KB
testcase_17 AC 132 ms
57,524 KB
testcase_18 AC 132 ms
57,340 KB
testcase_19 AC 181 ms
57,332 KB
testcase_20 AC 254 ms
57,420 KB
testcase_21 AC 218 ms
57,392 KB
testcase_22 AC 223 ms
57,492 KB
testcase_23 AC 189 ms
57,424 KB
testcase_24 AC 200 ms
57,628 KB
testcase_25 AC 191 ms
57,488 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.math.*;
import java.io.*;
 
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long nn = n;
		ArrayList<Integer> list = new ArrayList<Integer>();
		long tmp = (long)Math.sqrt(n);
		for(int i = 2; i <= tmp; i++) {
			while(n % i == 0) {
				list.add(i);
				n /= i;
			}
		}
		if(list.size() > 2 || list.size() >= 1 && tmp*tmp != nn) System.out.println("YES");
		else System.out.println("NO");
	}
}
0