結果

問題 No.36 素数が嫌い!
ユーザー scachescache
提出日時 2014-10-09 20:58:07
言語 Java21
(openjdk 21)
結果
AC  
実行時間 239 ms / 5,000 ms
コード長 590 bytes
コンパイル時間 3,579 ms
コンパイル使用メモリ 71,964 KB
実行使用メモリ 57,068 KB
最終ジャッジ日時 2023-09-09 07:03:36
合計ジャッジ時間 8,930 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 152 ms
55,864 KB
testcase_01 AC 129 ms
55,768 KB
testcase_02 AC 123 ms
55,820 KB
testcase_03 AC 121 ms
55,644 KB
testcase_04 AC 122 ms
55,716 KB
testcase_05 AC 123 ms
55,572 KB
testcase_06 AC 126 ms
55,692 KB
testcase_07 AC 127 ms
55,708 KB
testcase_08 AC 123 ms
55,772 KB
testcase_09 AC 126 ms
55,784 KB
testcase_10 AC 123 ms
55,516 KB
testcase_11 AC 164 ms
55,640 KB
testcase_12 AC 236 ms
55,684 KB
testcase_13 AC 239 ms
56,360 KB
testcase_14 AC 125 ms
55,796 KB
testcase_15 AC 125 ms
55,704 KB
testcase_16 AC 126 ms
55,816 KB
testcase_17 AC 122 ms
56,068 KB
testcase_18 AC 124 ms
55,612 KB
testcase_19 AC 130 ms
56,064 KB
testcase_20 AC 132 ms
55,800 KB
testcase_21 AC 142 ms
55,664 KB
testcase_22 AC 128 ms
55,768 KB
testcase_23 AC 128 ms
57,068 KB
testcase_24 AC 142 ms
55,776 KB
testcase_25 AC 148 ms
55,816 KB
testcase_26 AC 167 ms
56,000 KB
testcase_27 AC 128 ms
55,820 KB
testcase_28 AC 165 ms
55,524 KB
testcase_29 AC 126 ms
55,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

/**
 * yukicoder no.36
 * @author scache
 *
 */
public class NotLikePrimeNumber{
	public static void main(String[] args) {
		NotLikePrimeNumber p = new NotLikePrimeNumber();
	}

	public NotLikePrimeNumber(){
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		System.out.println(solve(n));
	}
	
	public String solve(long n){
		int count = 0;
		for(long i=2;i*i<=n;i++){
			while(n%i == 0){
				n /= i;
				count++;
			}
		}
		
		if(n>1)
			count++;
		
		if(count>=3)
			return "YES";
		else
			return "NO";
	}
}
0