結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 220 ms
55,324 KB
testcase_02 AC 127 ms
55,644 KB
testcase_03 AC 126 ms
55,772 KB
testcase_04 AC 126 ms
55,800 KB
testcase_05 AC 126 ms
55,636 KB
testcase_06 AC 127 ms
55,772 KB
testcase_07 AC 128 ms
55,648 KB
testcase_08 AC 126 ms
55,868 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 166 ms
55,764 KB
testcase_12 AC 243 ms
55,660 KB
testcase_13 AC 243 ms
55,596 KB
testcase_14 WA -
testcase_15 AC 125 ms
55,580 KB
testcase_16 AC 126 ms
55,312 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 193 ms
55,424 KB
testcase_25 WA -
testcase_26 AC 199 ms
55,976 KB
testcase_27 AC 228 ms
55,752 KB
testcase_28 AC 198 ms
55,652 KB
testcase_29 AC 240 ms
55,920 KB
権限があれば一括ダウンロードができます

ソースコード

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 "NO";
		return "YES";
	}
}
0