結果
| 問題 |
No.8023 素数判定するだけ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-03-31 23:23:36 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 821 bytes |
| コンパイル時間 | 715 ms |
| コンパイル使用メモリ | 77,184 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-07 05:48:14 |
| 合計ジャッジ時間 | 4,307 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 25 |
ソースコード
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
#include<stack>
#include<queue>
#include<vector>
typedef long long int ll;
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<=(b);i++)
int N,a,b;
int zero;
int one;
std::vector<int> SOSU;
int main(){
ios_base::sync_with_stdio(false);
one++;
cin>>N;
if(N==one){
cout<<"NO"<<endl;
return zero;
}
one++;
FOR(i,one,N){
if(!(SOSU.size())){
SOSU.push_back(i);
continue;
}
for(auto x:SOSU){
if(!(i%x))break;
if(x==SOSU.back()){
SOSU.push_back(i);
}
}
}
if(SOSU.back()==N)cout<<"YES"<<endl;
else cout<<"NO"<<endl;
return zero;
}