結果
問題 |
No.8023 素数判定するだけ
|
ユーザー |
|
提出日時 | 2020-02-06 00:31:07 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 498 bytes |
コンパイル時間 | 988 ms |
コンパイル使用メモリ | 86,844 KB |
最終ジャッジ日時 | 2025-01-08 22:26:40 |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 WA * 1 |
ソースコード
#include <iostream> #include <algorithm> #include <numeric> #include <vector> #include <functional> constexpr int ONE = true; constexpr int TWO = std::plus<int>{}(ONE,ONE); constexpr int ZERO = std::minus<int>{}(ONE,ONE); int main() { int N;std::cin>>N; for(int p = TWO; std::multiplies<int>{}(p,p)<=N;p=std::plus<int>{}(p,ONE)){ if(N%p==ZERO){ std::cout << "NO"<<std::endl; return ZERO; } } std::cout << "YES"<<std::endl; return ZERO; }