結果

問題 No.1058 素敵な数
ユーザー sigmanisigmani
提出日時 2022-02-20 16:33:27
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 477 bytes
コンパイル時間 1,566 ms
コンパイル使用メモリ 169,564 KB
実行使用メモリ 5,256 KB
最終ジャッジ日時 2023-09-11 21:03:09
合計ジャッジ時間 16,541 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,298 ms
4,376 KB
testcase_01 AC 1,298 ms
4,380 KB
testcase_02 AC 1,301 ms
4,376 KB
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;
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<=103220;i++){
    for(long long j=100001;j<=103220;j++){
      if(isPrime(i)&&isPrime(j))Q.push(i*j);
    }
  }
  for(int i=1;i<=N-1;i++){   
    Q.pop();
  }
  cout<<Q.top();




}
0