結果

問題 No.1058 素敵な数
ユーザー milanis48663220milanis48663220
提出日時 2020-05-22 21:31:12
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 618 bytes
コンパイル時間 997 ms
コンパイル使用メモリ 85,240 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-15 15:57:41
合計ジャッジ時間 1,732 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
6,812 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <queue>
#include <set>
#include <map>

using namespace std;
typedef long long ll;

bool ok[300001];

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << setprecision(10) << fixed;
    for(int i = 1; i <= 300000; i++) ok[i] = true;
    for(int i = 2; i <= 100000; i++){
        for(int j = 1; i*j <= 300000; j++){
            ok[i*j] = false;
        }
    }
    vector<int> v;
    for(int i = 1; i <= 300000; i++){
        if(ok[i]) v.push_back(i);
    }
    int N;
    cin >> N;
    cout  << v[N-1] << endl;
}
0