結果
問題 |
No.1058 素敵な数
|
ユーザー |
|
提出日時 | 2022-02-20 16:32:06 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 477 bytes |
コンパイル時間 | 1,780 ms |
コンパイル使用メモリ | 170,704 KB |
実行使用メモリ | 16,204 KB |
最終ジャッジ日時 | 2024-06-29 10:50:30 |
合計ジャッジ時間 | 7,892 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | TLE * 1 |
other | -- * 9 |
ソースコード
#include <bits/stdc++.h> using namespace std; bool isPrime(int x){ if(x==1)return 0; if(x==2)return 1; for(int i=2;i*i<=x;i++)if(x%i==0)return 0; return 1; } int main(){ int N; cin>>N; priority_queue<long long, vector<long long>, greater<long long >> Q; Q.push(1); for(long i=100001;i<=122220;i++){ for(long long j=100001;j<=122220;j++){ if(isPrime(i)&&isPrime(j))Q.push(i*j); } } for(int i=1;i<=N-1;i++){ Q.pop(); } cout<<Q.top(); }