結果
| 問題 | 
                            No.1058 素敵な数
                             | 
                    
| コンテスト | |
| ユーザー | 
                             QCFium
                         | 
                    
| 提出日時 | 2020-05-22 21:29:18 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 719 bytes | 
| コンパイル時間 | 1,468 ms | 
| コンパイル使用メモリ | 175,240 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2024-10-05 15:17:08 | 
| 合計ジャッジ時間 | 1,991 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 9 | 
ソースコード
#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;
}
            
            
            
        
            
QCFium