結果

問題 No.36 素数が嫌い!
ユーザー kuramukuramu
提出日時 2016-01-29 15:59:08
言語 Java21
(openjdk 21)
結果
AC  
実行時間 157 ms / 5,000 ms
コード長 657 bytes
コンパイル時間 3,133 ms
コンパイル使用メモリ 71,200 KB
実行使用メモリ 50,100 KB
最終ジャッジ日時 2023-09-09 07:31:27
合計ジャッジ時間 6,208 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
49,792 KB
testcase_01 AC 50 ms
49,688 KB
testcase_02 AC 42 ms
49,380 KB
testcase_03 AC 42 ms
49,332 KB
testcase_04 AC 42 ms
49,252 KB
testcase_05 AC 44 ms
49,672 KB
testcase_06 AC 43 ms
49,168 KB
testcase_07 AC 45 ms
49,116 KB
testcase_08 AC 42 ms
49,224 KB
testcase_09 AC 42 ms
49,084 KB
testcase_10 AC 42 ms
49,344 KB
testcase_11 AC 86 ms
49,780 KB
testcase_12 AC 157 ms
49,796 KB
testcase_13 AC 157 ms
50,100 KB
testcase_14 AC 43 ms
49,300 KB
testcase_15 AC 42 ms
49,264 KB
testcase_16 AC 41 ms
49,132 KB
testcase_17 AC 42 ms
49,264 KB
testcase_18 AC 42 ms
49,176 KB
testcase_19 AC 54 ms
49,684 KB
testcase_20 AC 53 ms
49,676 KB
testcase_21 AC 65 ms
49,576 KB
testcase_22 AC 49 ms
49,204 KB
testcase_23 AC 45 ms
49,144 KB
testcase_24 AC 67 ms
49,788 KB
testcase_25 AC 68 ms
49,708 KB
testcase_26 AC 88 ms
49,572 KB
testcase_27 AC 50 ms
49,276 KB
testcase_28 AC 87 ms
49,996 KB
testcase_29 AC 44 ms
49,168 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) {
	      BufferedReader stdReader =new BufferedReader(new InputStreamReader(System.in));
	      try {
	    	  long num = Long.parseLong(stdReader.readLine());
	    	  int count = 0;
	    	  for(long i=2;i*i<num+1;i++){
	    		  while(num%i==0){
	    			  num /= i;
	    			  count++;
	    		  }
	    	  }	    	  
	    	  if(num>1) count++;
	    	  if(count >= 3) System.out.println("YES");
	    	  else System.out.println("NO");

	      } catch (IOException e) {
			e.printStackTrace();
	      }
	}
	
}
0