結果

問題 No.36 素数が嫌い!
ユーザー rf141rf141
提出日時 2015-08-06 00:30:21
言語 Java21
(openjdk 21)
結果
AC  
実行時間 234 ms / 5,000 ms
コード長 404 bytes
コンパイル時間 3,378 ms
コンパイル使用メモリ 71,804 KB
実行使用メモリ 56,348 KB
最終ジャッジ日時 2023-09-09 07:15:48
合計ジャッジ時間 8,854 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 152 ms
55,788 KB
testcase_01 AC 129 ms
56,056 KB
testcase_02 AC 124 ms
55,788 KB
testcase_03 AC 123 ms
55,724 KB
testcase_04 AC 123 ms
55,932 KB
testcase_05 AC 125 ms
55,536 KB
testcase_06 AC 123 ms
55,732 KB
testcase_07 AC 124 ms
55,644 KB
testcase_08 AC 122 ms
55,500 KB
testcase_09 AC 123 ms
56,000 KB
testcase_10 AC 124 ms
56,060 KB
testcase_11 AC 162 ms
55,688 KB
testcase_12 AC 234 ms
55,692 KB
testcase_13 AC 232 ms
55,632 KB
testcase_14 AC 121 ms
56,056 KB
testcase_15 AC 119 ms
55,592 KB
testcase_16 AC 118 ms
56,348 KB
testcase_17 AC 120 ms
55,556 KB
testcase_18 AC 119 ms
56,104 KB
testcase_19 AC 131 ms
55,912 KB
testcase_20 AC 130 ms
55,672 KB
testcase_21 AC 142 ms
55,996 KB
testcase_22 AC 129 ms
56,004 KB
testcase_23 AC 127 ms
55,744 KB
testcase_24 AC 141 ms
55,988 KB
testcase_25 AC 144 ms
56,104 KB
testcase_26 AC 165 ms
56,240 KB
testcase_27 AC 128 ms
55,772 KB
testcase_28 AC 163 ms
55,792 KB
testcase_29 AC 127 ms
55,920 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class hate{
	public static void main(String... args){
		Scanner scan = new Scanner(System.in);
		long n = scan.nextLong();
		System.out.println(judge(n));
	}
	public static String judge(long n){
		long N = n;
		int count = 0;
		for(long i = 2; i*i <= N; i++){
			while(N%i==0){
				N /= i;
				count++;
			}
		}
		if(N>1)count++;
		if(count>=3)return "YES";
		return "NO";
	}
}
0