結果

問題 No.1149 色塗りゲーム
ユーザー RTnFRTnF
提出日時 2020-08-07 21:34:26
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 113 ms / 2,000 ms
コード長 2,785 bytes
コンパイル時間 2,058 ms
コンパイル使用メモリ 197,768 KB
実行使用メモリ 24,348 KB
平均クエリ数 19.88
最終ジャッジ日時 2023-09-24 04:08:19
合計ジャッジ時間 8,081 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
23,988 KB
testcase_01 AC 40 ms
23,340 KB
testcase_02 AC 41 ms
23,580 KB
testcase_03 AC 43 ms
23,472 KB
testcase_04 AC 41 ms
23,760 KB
testcase_05 AC 42 ms
23,964 KB
testcase_06 AC 40 ms
23,532 KB
testcase_07 AC 41 ms
23,376 KB
testcase_08 AC 42 ms
23,352 KB
testcase_09 AC 41 ms
23,592 KB
testcase_10 AC 43 ms
23,604 KB
testcase_11 AC 43 ms
23,580 KB
testcase_12 AC 43 ms
23,412 KB
testcase_13 AC 43 ms
24,216 KB
testcase_14 AC 43 ms
23,328 KB
testcase_15 AC 43 ms
23,424 KB
testcase_16 AC 43 ms
23,664 KB
testcase_17 AC 44 ms
24,168 KB
testcase_18 AC 43 ms
23,544 KB
testcase_19 AC 45 ms
24,336 KB
testcase_20 AC 45 ms
23,676 KB
testcase_21 AC 44 ms
23,340 KB
testcase_22 AC 45 ms
23,316 KB
testcase_23 AC 45 ms
23,676 KB
testcase_24 AC 46 ms
23,976 KB
testcase_25 AC 46 ms
24,324 KB
testcase_26 AC 45 ms
23,652 KB
testcase_27 AC 45 ms
23,316 KB
testcase_28 AC 45 ms
23,316 KB
testcase_29 AC 47 ms
23,580 KB
testcase_30 AC 84 ms
24,012 KB
testcase_31 AC 80 ms
23,748 KB
testcase_32 AC 83 ms
23,640 KB
testcase_33 AC 82 ms
23,388 KB
testcase_34 AC 90 ms
23,364 KB
testcase_35 AC 83 ms
23,832 KB
testcase_36 AC 91 ms
23,952 KB
testcase_37 AC 92 ms
23,364 KB
testcase_38 AC 90 ms
24,264 KB
testcase_39 AC 91 ms
23,772 KB
testcase_40 AC 96 ms
23,700 KB
testcase_41 AC 93 ms
24,240 KB
testcase_42 AC 101 ms
23,532 KB
testcase_43 AC 95 ms
24,036 KB
testcase_44 AC 106 ms
24,348 KB
testcase_45 AC 102 ms
23,940 KB
testcase_46 AC 103 ms
24,228 KB
testcase_47 AC 104 ms
23,364 KB
testcase_48 AC 103 ms
23,364 KB
testcase_49 AC 113 ms
23,640 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma region template
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vld = vector<ld>;
using vvld = vector<vld>;
using vvvld = vector<vvld>;
using vs = vector<string>;
using pll = pair<ll, ll>;
using vp = vector<pll>;
template <typename T>
using pqrev = priority_queue<T, vector<T>, greater<T>>;
#define rep(i, n) for (ll i = 0, i##_end = (n); i < i##_end; i++)
#define repb(i, n) for (ll i = (n)-1; i >= 0; i--)
#define repr(i, a, b) for (ll i = (a), i##_end = (b); i < i##_end; i++)
#define reprb(i, a, b) for (ll i = (b)-1, i##_end = (a); i >= i##_end; i--)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((ll)(x).size())
//*
constexpr ll MOD = 1e9 + 7;
/*/
constexpr ll MOD = 998244353;
//*/
constexpr ll INF = 1e+18;
constexpr ld EPS = 1e-12L;
constexpr ld PI = 3.14159265358979323846L;
constexpr ll GCD(ll a, ll b) { return b ? GCD(b, a % b) : a; }
constexpr ll LCM(ll a, ll b) { return a / GCD(a, b) * b; }
template <typename S, typename T>
constexpr bool chmax(S &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename S, typename T>
constexpr bool chmin(S &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
#ifdef OJ_LOCAL
#include "dump.hpp"
#else
#define dump(...) ((void)0)
#endif
template <typename T>
bool print_(const T &a) {
  cout << a;
  return true;
}
template <typename T>
bool print_(const vector<T> &vec) {
  for (auto &a : vec) {
    cout << a;
    if (&a != &vec.back()) {
      cout << " ";
    }
  }
  return false;
}
template <typename T>
bool print_(const vector<vector<T>> &vv) {
  for (auto &v : vv) {
    for (auto &a : v) {
      cout << a;
      if (&a != &v.back()) {
        cout << " ";
      }
    }
    if (&v != &vv.back()) {
      cout << "\n";
    }
  }
  return false;
}
void print() { cout << "\n"; }
template <typename Head, typename... Tail>
void print(Head &&head, Tail &&... tail) {
  bool f = print_(head);
  if (sizeof...(tail) != 0) {
    cout << (f ? " " : "\n");
  }
  print(forward<Tail>(tail)...);
}
#pragma endregion

void Pr(bool f){
  cout << (f ? "Yes" : "No") << "\n";
  exit(0);
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(20);
  ll n;
  cin >> n;
  print(2-(n%2), (n+1)/2);
  cout.flush();
  ll st = (n+1)/2 + 2-(n%2);
  while(1){
    ll t;
    cin >> t;
    if(t == 0) break;
    assert(t == 3);
    ll k, x;
    cin >> k >> x;
    if(x < (n+1)/2){
      print(k, x + st - 1);
      cout.flush();
    }else{
      print(k, x - st + 1);
      cout.flush();
    }
  }
}
0