結果

問題 No.1058 素敵な数
ユーザー le_panda_noirle_panda_noir
提出日時 2020-06-14 20:53:00
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 586 bytes
コンパイル時間 657 ms
コンパイル使用メモリ 77,920 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-09-10 06:39:46
合計ジャッジ時間 1,378 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 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 <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