結果
問題 | No.1058 素敵な数 |
ユーザー |
|
提出日時 | 2020-07-07 12:57:44 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 12 ms / 2,000 ms |
コード長 | 461 bytes |
コンパイル時間 | 5,582 ms |
コンパイル使用メモリ | 198,380 KB |
最終ジャッジ日時 | 2025-01-11 16:40:09 |
ジャッジサーバーID (参考情報) |
judge1 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 9 |
ソースコード
#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()<7){ if(v.at(i))p.emplace_back(i); ++i; } int n; cin>>n; --n; vector<int>f={0,1,1,2,1,1,1,2,2,1},s={0,1,2,2,3,4,5,3,4,6}; cout<<p.at(f.at(n))*p.at(s.at(n))<<"\n"s; }