結果

問題 No.36 素数が嫌い!
ユーザー kou6839kou6839
提出日時 2014-12-08 16:28:34
言語 Java21
(openjdk 21)
結果
AC  
実行時間 235 ms / 5,000 ms
コード長 448 bytes
コンパイル時間 2,563 ms
コンパイル使用メモリ 72,688 KB
実行使用メモリ 56,244 KB
最終ジャッジ日時 2023-09-09 07:04:47
合計ジャッジ時間 7,638 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 154 ms
56,032 KB
testcase_01 AC 134 ms
55,820 KB
testcase_02 AC 128 ms
55,692 KB
testcase_03 AC 124 ms
55,808 KB
testcase_04 AC 125 ms
55,824 KB
testcase_05 AC 125 ms
55,756 KB
testcase_06 AC 125 ms
55,708 KB
testcase_07 AC 125 ms
55,624 KB
testcase_08 AC 126 ms
55,436 KB
testcase_09 AC 125 ms
55,472 KB
testcase_10 AC 124 ms
55,548 KB
testcase_11 AC 162 ms
55,760 KB
testcase_12 AC 234 ms
56,060 KB
testcase_13 AC 235 ms
55,700 KB
testcase_14 AC 126 ms
55,748 KB
testcase_15 AC 124 ms
56,028 KB
testcase_16 AC 127 ms
56,108 KB
testcase_17 AC 127 ms
53,896 KB
testcase_18 AC 123 ms
55,764 KB
testcase_19 AC 131 ms
55,460 KB
testcase_20 AC 131 ms
55,732 KB
testcase_21 AC 141 ms
56,036 KB
testcase_22 AC 132 ms
56,104 KB
testcase_23 AC 127 ms
55,432 KB
testcase_24 AC 145 ms
55,748 KB
testcase_25 AC 145 ms
55,696 KB
testcase_26 AC 170 ms
55,848 KB
testcase_27 AC 131 ms
56,244 KB
testcase_28 AC 165 ms
55,636 KB
testcase_29 AC 128 ms
56,176 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(n>1) count++;
		if(count>2){
			System.out.println("YES");
		}else
		System.out.println("NO");
	}
}	
0