結果
| 問題 |
No.1058 素敵な数
|
| コンテスト | |
| ユーザー |
mmn15277198
|
| 提出日時 | 2020-06-29 09:37:38 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 660 bytes |
| コンパイル時間 | 964 ms |
| コンパイル使用メモリ | 100,644 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-18 06:48:09 |
| 合計ジャッジ時間 | 1,412 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | WA * 9 |
ソースコード
#pragma GCC optimize("Ofast")
#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<string.h>
#include<math.h>
#include<map>
#include<iomanip>
#include<queue>
const long long INF = 1e17+7;
const long long MOD = 1e9+7;
const double PI=acos(-1);
using namespace std;
bool is_prime(long long x){
bool res=true;
for(long long i=2;i*i<=x;i++){
if(x%i==0){
res=false;
return res;
}
}
return res;
}
int main(){
int n;
cin >> n;
long long start=100001;
vector<long long> v;
v.push_back(1);
while(1){
if(v.size()==n)break;
if(is_prime(start)){
v.push_back(start);
}
start++;
}
cout << v[n-1] << endl;
}
mmn15277198