結果

問題 No.1058 素敵な数
ユーザー QCFiumQCFium
提出日時 2020-05-22 21:27:56
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 659 bytes
コンパイル時間 2,168 ms
コンパイル使用メモリ 171,016 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-15 15:48:50
合計ジャッジ時間 2,704 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
6,816 KB
testcase_01 AC 3 ms
6,940 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 <bits/stdc++.h>

typedef uint32_t u32;
typedef uint64_t u64;
typedef int32_t s32;
typedef int64_t s64;

s32 ri() {
	s32 n;
	scanf("%" SCNd32, &n);
	return n;
}
int main() {
#define int WHOOOO // 脱int訓練中につき許して
	bool fu[100500] = { 0 };
	for (s32 i = 2; i < 100500; i++) {
		if (fu[i]) continue;
		for (s32 j = i * 2; j < 100500; j += i) fu[j] = true;
	}
	std::vector<s32> all;
	for (s32 i = 100000; i < 100500; i++) if (!fu[i]) all.push_back(i);
	std::vector<s64> res{ 1 };
	for (auto i : all) for (auto j : all) res.push_back((s64) i * j);
	std::sort(res.begin(), res.end());
	printf("%" PRId64 "\n", res[ri() - 1]);
	return 0;
}
0