結果

問題 No.1058 素敵な数
ユーザー evawenisevawenis
提出日時 2020-07-07 04:09:06
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 461 bytes
コンパイル時間 2,195 ms
コンパイル使用メモリ 207,564 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-25 07:30:34
合計ジャッジ時間 2,984 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
4,348 KB
testcase_01 WA -
testcase_02 WA -
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;

int main(){
	cin.tie(0),ios::sync_with_stdio(false);
	vector<bool>v(1e6+1,true);
	for(int i=2;i*i<=1e6;++i){
		if(!v.at(i))continue;
		for(int j=i*i;j<=1e6;j+=i){
			v.at(j)=false;
		}
	}
	vector<int64_t>p(1,1);
	int i=1e5+1;
	while(p.size()<6){
		if(v.at(i))p.emplace_back(i);
		++i;
	}
	int n; cin>>n; --n;
	vector<int>f={0,1,1,2,1,2,3,1,2,3},s={0,2,3,3,4,4,4,5,5,5};
	cout<<p.at(f.at(n))*p.at(s.at(n))<<"\n"s;
}
0