結果

問題 No.36 素数が嫌い!
ユーザー ym678ym678
提出日時 2016-08-28 19:15:33
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 432 bytes
コンパイル時間 2,332 ms
コンパイル使用メモリ 73,784 KB
実行使用メモリ 41,716 KB
最終ジャッジ日時 2024-04-26 17:00:51
合計ジャッジ時間 7,106 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 AC 119 ms
40,712 KB
testcase_03 AC 115 ms
40,196 KB
testcase_04 AC 117 ms
40,496 KB
testcase_05 AC 113 ms
40,004 KB
testcase_06 AC 113 ms
40,436 KB
testcase_07 AC 125 ms
41,308 KB
testcase_08 AC 127 ms
41,028 KB
testcase_09 AC 109 ms
39,608 KB
testcase_10 AC 115 ms
40,084 KB
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 AC 113 ms
39,852 KB
testcase_16 AC 112 ms
40,212 KB
testcase_17 AC 122 ms
41,268 KB
testcase_18 AC 124 ms
41,148 KB
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

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