結果

問題 No.36 素数が嫌い!
ユーザー kano_townkano_town
提出日時 2014-12-12 14:48:19
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 334 bytes
コンパイル時間 3,173 ms
コンパイル使用メモリ 73,336 KB
実行使用メモリ 57,864 KB
最終ジャッジ日時 2023-09-02 14:22:15
合計ジャッジ時間 9,528 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 133 ms
55,724 KB
testcase_01 WA -
testcase_02 AC 128 ms
55,696 KB
testcase_03 AC 126 ms
55,584 KB
testcase_04 AC 131 ms
55,628 KB
testcase_05 AC 131 ms
55,732 KB
testcase_06 AC 129 ms
55,644 KB
testcase_07 AC 129 ms
56,188 KB
testcase_08 WA -
testcase_09 AC 131 ms
55,540 KB
testcase_10 WA -
testcase_11 AC 172 ms
55,648 KB
testcase_12 AC 250 ms
55,840 KB
testcase_13 AC 247 ms
55,360 KB
testcase_14 AC 127 ms
55,636 KB
testcase_15 WA -
testcase_16 AC 127 ms
55,668 KB
testcase_17 AC 128 ms
55,520 KB
testcase_18 AC 126 ms
55,632 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 125 ms
55,948 KB
testcase_26 AC 197 ms
55,632 KB
testcase_27 AC 227 ms
55,768 KB
testcase_28 AC 202 ms
53,344 KB
testcase_29 AC 242 ms
55,780 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Yukicoder36 {

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