結果
| 問題 |
No.8023 素数判定するだけ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-03-31 22:59:10 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 642 bytes |
| コンパイル時間 | 2,132 ms |
| コンパイル使用メモリ | 74,780 KB |
| 実行使用メモリ | 41,932 KB |
| 最終ジャッジ日時 | 2024-07-07 05:11:44 |
| 合計ジャッジ時間 | 7,671 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 25 |
ソースコード
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
class Main {
public static void main(String[] args) {
new Main().run();
}
void run() {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
if (N == BigInteger.ZERO.intValue()) {
System.out.println("NO");
return;
}
for (int i = BigInteger.ONE.add(BigInteger.ONE).intValue(); i < N; ++i) {
if (N % i == BigInteger.ZERO.intValue()) {
System.out.println("NO");
return;
}
}
System.out.println("YES");
}
void tr(Object... objects) {
System.out.println(Arrays.deepToString(objects));
}
}