結果

問題 No.8023 素数判定するだけ
ユーザー Pachicobue
提出日時 2020-02-06 00:29:25
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 485 bytes
コンパイル時間 840 ms
コンパイル使用メモリ 88,744 KB
最終ジャッジ日時 2025-01-08 22:26:29
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1 WA * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

#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){ continue; }
        std::cout << "YES"<<std::endl;
        return ZERO;
    }
    std::cout << "NO"<<std::endl;
    return ZERO;
}
0