結果

問題 No.8023 素数判定するだけ
ユーザー kotatsugame
提出日時 2020-03-09 04:26:02
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 1,000 ms
コード長 240 bytes
コンパイル時間 644 ms
コンパイル使用メモリ 69,504 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-07 20:41:10
合計ジャッジ時間 4,533 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:8:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    8 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
#include<numeric>
#include<vector>
using namespace std;
int N;
enum{Z,O,T};
int f;
main()
{
	cin>>N;
	f=N==O;
	vector<int>i(N);
	iota(i.begin(),i.end(),(int)T);
	for(int j:i)f|=j<N&&!(N%j);
	cout<<(f?"NO":"YES")<<endl;
}
0