結果
問題 | No.8023 素数判定するだけ |
ユーザー |
![]() |
提出日時 | 2017-03-31 22:50:05 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 115 ms / 1,000 ms |
コード長 | 533 bytes |
コンパイル時間 | 2,820 ms |
コンパイル使用メモリ | 76,204 KB |
実行使用メモリ | 54,228 KB |
最終ジャッジ日時 | 2024-10-04 19:57:09 |
合計ジャッジ時間 | 8,416 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
ソースコード
import java.math.BigInteger; import java.util.Scanner; public class yuki { public static void main(String[] args) { Scanner sc = new Scanner(System.in); BigInteger b = sc.nextBigInteger(); for (BigInteger i = BigInteger.ONE.add(BigInteger.ONE); i.compareTo(b) < BigInteger.ZERO.intValue(); i = i.add(BigInteger.ONE)) { if (b.mod(i).equals(BigInteger.ZERO)) { System.out.println("NO"); return; } } if (b.equals(BigInteger.ONE)) { System.out.println("NO"); return; } System.out.println("YES"); } }