結果

問題 No.3023 素数判定するだけ
ユーザー ぴろずぴろず
提出日時 2017-03-31 23:26:35
言語 Java21
(openjdk 21)
結果
AC  
実行時間 144 ms / 1,000 ms
コード長 399 bytes
コンパイル時間 1,894 ms
コンパイル使用メモリ 76,256 KB
実行使用メモリ 55,128 KB
最終ジャッジ日時 2024-04-15 06:29:43
合計ジャッジ時間 8,465 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
54,536 KB
testcase_01 AC 142 ms
54,868 KB
testcase_02 AC 136 ms
54,608 KB
testcase_03 AC 133 ms
54,628 KB
testcase_04 AC 144 ms
54,684 KB
testcase_05 AC 125 ms
54,656 KB
testcase_06 AC 139 ms
54,432 KB
testcase_07 AC 138 ms
55,128 KB
testcase_08 AC 126 ms
54,620 KB
testcase_09 AC 133 ms
54,528 KB
testcase_10 AC 123 ms
54,740 KB
testcase_11 AC 136 ms
54,576 KB
testcase_12 AC 136 ms
54,676 KB
testcase_13 AC 141 ms
55,020 KB
testcase_14 AC 125 ms
54,516 KB
testcase_15 AC 126 ms
54,624 KB
testcase_16 AC 133 ms
54,604 KB
testcase_17 AC 140 ms
54,728 KB
testcase_18 AC 127 ms
54,512 KB
testcase_19 AC 135 ms
54,776 KB
testcase_20 AC 143 ms
54,916 KB
testcase_21 AC 121 ms
54,448 KB
testcase_22 AC 135 ms
54,760 KB
testcase_23 AC 128 ms
54,872 KB
testcase_24 AC 133 ms
54,924 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.lang.reflect.Method;
import java.math.BigInteger;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws Exception {
		BigInteger n = new Scanner(System.in).nextBigInteger();
		Method ipp = n.getClass().getMethod("isProbablePlime".replace("li", "ri"), int.class);
		System.out.println((boolean) ipp.invoke(n, (int) Math.PI) ? "YES" : "NO");
	}

}
0