結果

問題 No.1058 素敵な数
ユーザー FujiyanosukeFujiyanosuke
提出日時 2020-05-23 09:59:56
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,624 bytes
コンパイル時間 1,955 ms
コンパイル使用メモリ 170,796 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-16 11:49:25
合計ジャッジ時間 2,260 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll = long long; 
using ull = unsigned long long;
using V = vector<int>;
using VV = vector<vector<int>>;
using VVV = vector<vector<vector<int>>>;
using VL = vector<ll>;
using VVL = vector<vector<ll>>;
using VVVL = vector<vector<vector<ll>>>;
template<class T> using P = pair<T, T>;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define REP(i,k,n) for(int i=(k);i<(n);i++)
#define all(a) (a).begin(),(a).end()
#define output(x,y) cout << fixed << setprecision(y) << x << endl;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
const ll MOD = 1e9 + 7;
// const ll MOD = 998244353;
ll upper = MOD + MOD;
ll under = -upper;
ll UPPER = MOD * MOD;
ll UNDER = -UPPER;
const long double pi = 3.141592653589793;
bool is_prime(ll x) {
	for (ll i = 2; i * i <= x; i++) {
		if (x % i == 0) return false;
	}
	return true;
}
ll primes[] = { 100003,
100019,
100043,
100049,
100057,
100069,
100103,
100109,
100129,
100151,
100153,
100169,
100183,
100189,
100193,
100207,
100213,
100237,
100267,
100271 };
int main() { // 問題文はしっかり読め!!!
	int n;
	cin >> n;
	if (n == 1) cout << 1 << endl;
	else {
		VL primecross;
		rep(i, 20) {
			rep(j, 20) {
				primecross.push_back(primes[i] * primes[j]);
			}
		}
		sort(all(primecross));
		--n;
		cout << primecross[--n] << endl;
	}
	return 0;
}
0