結果

問題 No.1058 素敵な数
ユーザー le_panda_noirle_panda_noir
提出日時 2020-06-14 20:54:39
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 585 bytes
コンパイル時間 732 ms
コンパイル使用メモリ 78,272 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-10 06:42:13
合計ジャッジ時間 1,397 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

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;
  ll v[] = {100003, 100019, 100043, 100049, 100057, 100069, 100103, 100109};
  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