結果

問題 No.36 素数が嫌い!
ユーザー rf141rf141
提出日時 2015-08-06 00:23:50
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 356 bytes
コンパイル時間 3,465 ms
コンパイル使用メモリ 73,196 KB
実行使用メモリ 56,352 KB
最終ジャッジ日時 2023-09-25 04:04:37
合計ジャッジ時間 10,126 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 186 ms
55,692 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 128 ms
55,812 KB
testcase_10 AC 129 ms
55,680 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 202 ms
55,692 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 128 ms
55,980 KB
testcase_18 AC 129 ms
55,764 KB
testcase_19 AC 175 ms
55,916 KB
testcase_20 AC 245 ms
55,668 KB
testcase_21 AC 218 ms
55,468 KB
testcase_22 AC 222 ms
55,672 KB
testcase_23 AC 185 ms
55,880 KB
testcase_24 WA -
testcase_25 AC 191 ms
55,476 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class hate{
	public static void main(String... args){
		Scanner scan = new Scanner(System.in);
		long n = scan.nextLong();
		System.out.println(judge(n));
	}
	public static String judge(long n){
		long N = n;
		for(long i = 2; i < Math.sqrt(n); i++){
			if(N%i==0){
				N /= i;
			}
		}
		if(N>1)return "YES";
		return "NO";
	}
}
0