結果
| 問題 |
No.8023 素数判定するだけ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-03-31 22:57:38 |
| 言語 | D (dmd 2.109.1) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 1,000 ms |
| コード長 | 509 bytes |
| コンパイル時間 | 719 ms |
| コンパイル使用メモリ | 111,872 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-12 18:34:51 |
| 合計ジャッジ時間 | 5,402 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 25 |
ソースコード
import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop;
const int zero = false;
const int one = true;
const int two = one << one;
void main() {
int N = readln.chomp.to!int;
if (N == one) {
"NO".writeln;
return;
}
foreach (i; two..N) {
if (N % i == zero) {
"NO".writeln;
return;
}
}
"YES".writeln;
}