結果

問題 No.36 素数が嫌い!
ユーザー kou6839kou6839
提出日時 2014-12-08 16:23:41
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 428 bytes
コンパイル時間 2,147 ms
コンパイル使用メモリ 71,208 KB
実行使用メモリ 56,312 KB
最終ジャッジ日時 2023-09-02 11:42:38
合計ジャッジ時間 8,322 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 129 ms
56,132 KB
testcase_03 AC 132 ms
56,196 KB
testcase_04 AC 135 ms
55,768 KB
testcase_05 AC 137 ms
55,480 KB
testcase_06 AC 131 ms
55,932 KB
testcase_07 AC 134 ms
55,556 KB
testcase_08 AC 136 ms
55,700 KB
testcase_09 AC 133 ms
55,784 KB
testcase_10 WA -
testcase_11 AC 175 ms
55,896 KB
testcase_12 AC 251 ms
55,836 KB
testcase_13 AC 249 ms
55,684 KB
testcase_14 AC 130 ms
56,132 KB
testcase_15 WA -
testcase_16 AC 134 ms
55,680 KB
testcase_17 AC 134 ms
55,836 KB
testcase_18 AC 135 ms
55,784 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 175 ms
55,776 KB
testcase_27 AC 137 ms
55,588 KB
testcase_28 AC 169 ms
55,780 KB
testcase_29 AC 135 ms
55,616 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.math.*;
import java.util.*;


public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n=sc.nextLong();
		if(n==1){
			System.out.println("NO");
			return;
		}
		int count=0;
		for(long i=2;i*i<=n;i++){
			while(n%i==0){
				n/=i;
				count++;
			}
		}
		if(count>2){
			System.out.println("YES");
		}else
		System.out.println("NO");
	}
}	
0