結果

問題 No.36 素数が嫌い!
ユーザー scache
提出日時 2014-10-09 20:58:07
言語 Java
(openjdk 23)
結果
AC  
実行時間 244 ms / 5,000 ms
コード長 590 bytes
コンパイル時間 3,388 ms
コンパイル使用メモリ 74,872 KB
実行使用メモリ 54,384 KB
最終ジャッジ日時 2024-06-27 00:12:28
合計ジャッジ時間 8,690 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

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