結果
| 問題 |
No.8023 素数判定するだけ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-03-31 22:39:40 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 137 ms / 1,000 ms |
| コード長 | 1,123 bytes |
| コンパイル時間 | 3,802 ms |
| コンパイル使用メモリ | 85,440 KB |
| 実行使用メモリ | 55,060 KB |
| 最終ジャッジ日時 | 2024-10-04 19:50:48 |
| 合計ジャッジ時間 | 9,249 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 25 |
ソースコード
import java.io.PrintWriter;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.math.BigInteger;
import java.util.Scanner;
public class EE {
static Scanner in;
static PrintWriter out;
static String INPUT = "";
static void solve()
{
int n = ni();
BigInteger N = BigInteger.valueOf(n);
for(Method m : BigInteger.class.getMethods()){
if(m.getName().startsWith("isP")){
try {
if((Boolean)m.invoke(N, BigInteger.TEN.intValue())){
out.println("YES");
}else{
out.println("NO");
}
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException
| SecurityException e) {
e.printStackTrace();
}
break;
}
}
}
public static void main(String[] args) throws Exception
{
in = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(INPUT);
out = new PrintWriter(System.out);
solve();
out.flush();
}
static int ni() { return Integer.parseInt(in.next()); }
static long nl() { return Long.parseLong(in.next()); }
static double nd() { return Double.parseDouble(in.next()); }
}