結果

問題 No.1058 素敵な数
ユーザー le_panda_noir
提出日時 2020-06-14 20:53:00
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 586 bytes
コンパイル時間 1,054 ms
コンパイル使用メモリ 75,776 KB
最終ジャッジ日時 2025-01-11 04:21:20
ジャッジサーバーID
(参考情報)
judge4 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <queue>

using namespace std;
using ll = long long;
#define rep(i,n) for(int i=0,_i=(n);i<_i;++i)

template<class T>using priority_queue_rev = priority_queue<T, vector<T>, greater<T>>;
int main() {
  int N; cin >> N;

  if (N == 1) {
    cout << 1 << endl;
    return 0;
  }
  priority_queue_rev<ll> q;
  int v[] = {10003, 10007, 10009, 10037, 10039, 10061, 10067, 10069, 10079};
  rep(i, 8) rep(j, 8) {
    if (j < i)
      continue;
    q.push(1LL * v[i] * v[j]);
  }
  rep(i, N-2)
    q.pop();
  cout << q.top() << endl;

  return 0;
}
0