結果

問題 No.36 素数が嫌い!
ユーザー kou6839
提出日時 2014-12-08 16:14:03
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 372 bytes
コンパイル時間 2,054 ms
コンパイル使用メモリ 75,360 KB
実行使用メモリ 60,960 KB
最終ジャッジ日時 2024-06-11 18:25:37
合計ジャッジ時間 9,730 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 4
other AC * 7 WA * 4 TLE * 1 -- * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.math.*;
import java.util.*;


public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n=sc.nextLong();
		if(n==1){
			System.out.println("NO");
			return;
		}
		for(int i=2;i*i<=n;i++){
			if(n%i==0){
				System.out.println("YES");
				return;
			}
		}
		System.out.println("NO");
	}
}	
0