結果

問題 No.1058 素敵な数
ユーザー d_seid_sei
提出日時 2020-05-24 09:35:44
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,333 bytes
コンパイル時間 1,286 ms
コンパイル使用メモリ 106,608 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-19 07:10:39
合計ジャッジ時間 1,706 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 2 ms
6,940 KB
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<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<sstream>
#include<iterator>
#include<list>

using namespace std;

typedef  long long int lint;

#define rep(i, n) for (lint i = 0; i < n; i++)
#define sort(v) sort((v).begin(), (v).end())
#define reverse(v) reverse((v).begin(), (v).end())
#define upper(v,hoge) upper_bound(v.begin(),v.end(),hoge)
#define lower(v,hoge) lower_bound(v.begin(),v.end(),hoge)
#define mp make_pair
#define enld endl

bool isprime(lint x) {
	//xが素数:true,xが素数でない:false
	if (x == 2) {
		return true;
	}
	else if (x == 1 || x % 2 == 0) {
		return false;
	}
	else {
		lint i = 3;
		while (i * i <= x) {
			if (x % i == 0) {
				return false;
			}
			i += 2;
		}
		return true;
	}
}

int main() {
	vector<lint>A;
	A = { 100003,100019,100043,100049,100057,100069 };
	vector<lint>B;
	rep(i, 6) {
		rep(j, 6) {
			B.push_back(A[i] * A[j]);
		}
	}
	sort(B);
	lint N;
	cin >> N;
	if (N == 1) {
		cout << 1 << endl;
	}
	else {
		cout << B[N - 2] << endl;
	}
}
/*
100003
100019
100043
100049
100057
100069
*/
0