結果

問題 No.1058 素敵な数
ユーザー soto800soto800
提出日時 2020-05-22 21:39:30
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,668 bytes
コンパイル時間 1,645 ms
コンパイル使用メモリ 169,104 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-15 16:18:58
合計ジャッジ時間 2,084 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
 
#define lli long long int
#define REP(i,s,n) for(int i=s;i<n;i++)
#define NUM 2520
#define INF (1LL<<50)
#define DEBUG 1
#define mp(a,b) make_pair(a,b)
#define SORT(V) sort(V.begin(),V.end())
#define PI (3.141592653589794)
#define TO_STRING(VariableName) # VariableName
#define LOG(x) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<endl;
#define LOG2(x,y) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<endl;
#define LOG3(x,y,z) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<" "<<TO_STRING(z)<<"="<<z<<endl;
#define LOG4(w,x,y,z) if(DEBUG)cout<<TO_STRING(w)<<"="<<w<<" "<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<" "<<TO_STRING(z)<<"="<<z<<endl;
 
template<class T>bool chmax(T & a, const T & b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }

vector<lli> makePrimeList(lli n){
    vector<lli> primeNums;
    bool isMultiple;
    for(lli i=2;i<=n;i++){
        isMultiple = false;
        lli size = primeNums.size();
        for(lli j=0;j<size;j++){
            if(i%primeNums[j]==0){
                isMultiple=true;
                break;
            }
        }
        if(!isMultiple){
            primeNums.push_back(i);
        }
    }
    return primeNums;
}

int main(){

	lli n;
	cin>>n;

	lli dd[12] = {100003,100019,100043,100049,100057,100069,100103,100109,100129,100151,100153};

	set<lli> ans;
	REP(i,0,11)REP(j,0,11){
		ans.insert(dd[i]*dd[j]);
	}
	ans.insert(1);

	lli cnt = 0;
	for(auto e:ans){
		cnt++;
		if(cnt==n){
			cout<<e<<endl;
			return 0;
		}
	}


    return 0;
}
0