結果

問題 No.1058 素敵な数
ユーザー heno239heno239
提出日時 2020-05-23 01:34:56
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,260 bytes
コンパイル時間 1,174 ms
コンパイル使用メモリ 114,728 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-15 22:28:37
合計ジャッジ時間 1,576 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
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<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<utility>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#include<cassert>
#include<random>
#include<unordered_map>
#include<numeric>
using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define all(v) (v).begin(),(v).end()
#define stop char nyaa;cin>>nyaa;


using P = pair<int, int>;
using ll = long long;
using LP = pair<ll, ll>;

const ll inf = 1000000007;
const ll INF = inf * inf;






bool isp(ll x) {
	ll k = sqrt(x + 0.1);
	for (int j = 2; j <= k + 1; j++) {
		if (j != x) {
			if (x%j == 0)return false;
		}
	}
	return true;
}


void solve() {
	int n;
	cin >> n;

	vector<ll> primes;

	int cur = 100000;
	while (primes.size() < 11) {
		if (isp(cur))primes.push_back(cur);
		cur++;
	}
	

	vector<ll> anss;
	rep(i, primes.size()) {
		for (int j = i; j < primes.size(); j++) {
			anss.push_back(primes[i] * primes[j]);
		}
	}

	sort(all(anss));
	cout << anss[n - 1] << "\n";
}


signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	//int t; cin >> t;rep(i, t)solve();
	solve();
	stop
	return 0;
}
0