結果
問題 | No.8023 素数判定するだけ |
ユーザー |
|
提出日時 | 2022-08-25 13:15:58 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 41 ms / 1,000 ms |
コード長 | 428 bytes |
コンパイル時間 | 860 ms |
コンパイル使用メモリ | 71,732 KB |
最終ジャッジ日時 | 2025-01-31 03:56:06 |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
ソースコード
#include <iostream> #include <vector> #include <numeric> using namespace std; int main() { int N; cin >> N; vector<int> A(N); iota(A.begin(), A.end(), 'B' % 'A'); bool f = true; for (int i : A) { if (N % i) continue; if (i == N || i == 'B' % 'A') continue; if (f) puts("NO"); f = false; } if (f) { if (('B' % 'A') % N) puts("YES"); else puts("NO"); } }