結果

問題 No.36 素数が嫌い!
ユーザー ym678ym678
提出日時 2016-08-28 19:16:49
言語 Java21
(openjdk 21)
結果
AC  
実行時間 236 ms / 5,000 ms
コード長 433 bytes
コンパイル時間 2,005 ms
コンパイル使用メモリ 71,100 KB
実行使用メモリ 56,456 KB
最終ジャッジ日時 2023-09-09 07:41:04
合計ジャッジ時間 7,410 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 152 ms
56,048 KB
testcase_01 AC 130 ms
55,728 KB
testcase_02 AC 124 ms
56,120 KB
testcase_03 AC 122 ms
55,436 KB
testcase_04 AC 123 ms
55,940 KB
testcase_05 AC 123 ms
55,804 KB
testcase_06 AC 126 ms
55,468 KB
testcase_07 AC 127 ms
55,928 KB
testcase_08 AC 121 ms
55,780 KB
testcase_09 AC 121 ms
55,608 KB
testcase_10 AC 123 ms
56,428 KB
testcase_11 AC 162 ms
55,808 KB
testcase_12 AC 236 ms
55,664 KB
testcase_13 AC 235 ms
56,008 KB
testcase_14 AC 123 ms
56,088 KB
testcase_15 AC 123 ms
55,604 KB
testcase_16 AC 122 ms
55,728 KB
testcase_17 AC 124 ms
55,396 KB
testcase_18 AC 128 ms
55,812 KB
testcase_19 AC 132 ms
55,608 KB
testcase_20 AC 133 ms
55,620 KB
testcase_21 AC 140 ms
56,456 KB
testcase_22 AC 129 ms
55,604 KB
testcase_23 AC 125 ms
55,984 KB
testcase_24 AC 143 ms
55,560 KB
testcase_25 AC 146 ms
56,028 KB
testcase_26 AC 167 ms
55,604 KB
testcase_27 AC 130 ms
55,612 KB
testcase_28 AC 164 ms
55,976 KB
testcase_29 AC 125 ms
55,956 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		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