結果

問題 No.1402 ビル街
ユーザー 👑 emthrmemthrm
提出日時 2021-02-19 23:23:56
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 3,153 ms
コード長 2,275 bytes
コンパイル時間 1,904 ms
コンパイル使用メモリ 201,096 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-16 23:16:00
合計ジャッジ時間 8,277 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,m,n) for(int i=(m);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
using ll = long long;
constexpr int INF = 0x3f3f3f3f;
constexpr long long LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr double EPS = 1e-8;
constexpr int MOD = 1000000007;
// constexpr int MOD = 998244353;
constexpr int dy[] = {1, 0, -1, 0}, dx[] = {0, -1, 0, 1};
constexpr int dy8[] = {1, 1, 0, -1, -1, -1, 0, 1}, dx8[] = {0, -1, -1, -1, 0, 1, 1, 1};
template <typename T, typename U> inline bool chmax(T &a, U b) { return a < b ? (a = b, true) : false; }
template <typename T, typename U> inline bool chmin(T &a, U b) { return a > b ? (a = b, true) : false; }
struct IOSetup {
  IOSetup() {
    std::cin.tie(nullptr);
    std::ios_base::sync_with_stdio(false);
    std::cout << fixed << setprecision(20);
  }
} iosetup;

int main() {
  constexpr int M = 2000000000;
  int n; cin >> n;
  if (n == 1) {
    cout << M << ' ' << 2 << ' ' << M << '\n';
  } else {
    cout << M << ' ' << n << ' ';
    REP(i, n - 2) cout << 2 + i << ' ';
    cout << n + 1 << ' ' << M << '\n';
  }
  return 0;

  // vector<int> ord(n);
  // iota(ALL(ord), 0);
  // int mn = INF;
  // do {
  //   vector<int> a(n + 2, n);
  //   REP(i, n) a[i + 1] = ord[i];
  //   vector<vector<int>> graph(n + 2);
  //   FOR(i, 1, n + 1) {
  //     int l = i - 1;
  //     while (a[l] < a[i]) --l;
  //     graph[i].emplace_back(l);
  //     graph[l].emplace_back(i);
  //     int r = i + 1;
  //     while (a[r] < a[i]) ++r;
  //     graph[i].emplace_back(r);
  //     graph[r].emplace_back(i);
  //   }
  //   int d = 0;
  //   FOR(i, 1, n + 1) {
  //     vector<int> dist(n + 2, -1);
  //     dist[i] = 0;
  //     queue<int> que({i});
  //     while (!que.empty()) {
  //       int v = que.front(); que.pop();
  //       for (int e : graph[v]) {
  //         if (dist[e] == -1) {
  //           dist[e] = dist[v] + 1;
  //           que.emplace(e);
  //         }
  //       }
  //     }
  //     FOR(j, 1, n + 1) d += dist[j];
  //   }
  //   chmin(mn, d);
  //   cout << '{';
  //   REP(i, n) cout << ord[i] << ",}"[i + 1 == n];
  //   cout << " " << d << '\n';
  // } while (next_permutation(ALL(ord)));
  // cout << mn << '\n';
}
0