結果

問題 No.1058 素敵な数
ユーザー QCFiumQCFium
提出日時 2020-05-22 21:29:18
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 719 bytes
コンパイル時間 1,811 ms
コンパイル使用メモリ 172,996 KB
実行使用メモリ 6,940 KB
最終ジャッジ日時 2024-04-15 15:53:36
合計ジャッジ時間 2,348 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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());
	res.erase(std::unique(res.begin(), res.end()), res.end());
	printf("%" PRId64 "\n", res[ri() - 1]);
	return 0;
}
0