結果

問題 No.1149 色塗りゲーム
コンテスト
ユーザー komakoko
提出日時 2026-05-11 02:54:52
言語 C++23
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 110 ms / 2,000 ms
コード長 1,569 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,398 ms
コンパイル使用メモリ 330,172 KB
実行使用メモリ 30,308 KB
平均クエリ数 19.88
最終ジャッジ日時 2026-05-11 02:55:03
合計ジャッジ時間 9,433 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define rep(i, n) for(ll i = 0; i < (ll)(n); ++i)
#define rep1(i, n) for(ll i = 1; i <= (ll)(n); ++i)
#define rrep(i, n) for(ll i = (ll)(n) - 1; i >= 0; --i)
#define rrep1(i, n) for(ll i = (ll)(n); i >= 1; --i)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#ifdef DEBUG
#define dbg if(true)
#else
#define dbg if(false)
#endif
template<typename T> bool chmin(T &a, const T &b) {if(a>b) {a=b; return true;} return false;}
template<typename T> bool chmax(T &a, const T &b) {if(a<b) {a=b; return true;} return false;}
template <typename T> void print(const T &a) {cout << a << '\n';}
template <typename T> void print(const vector<T> &v1) {for(int i=0; i<v1.size(); ++i){if(i) {cout << ' ';} cout << v1[i];} cout << '\n';}
template <typename T> void print(const vector<vector<T>> &v2) {for(int i=0; i<v2.size(); ++i) print(v2[i]); cout << '\n';}



void solve() {
  int n; cin >> n;
  if(n % 2 == 1) {
    cout << 1 << " " << n / 2 + 1 << endl;
  } else {
    cout << 2 << " " << n / 2 << endl;
  }
  while(true) {
    int t; cin >> t;
    if(t != 3) return;
    int k, x; cin >> k >> x;
    if(x > n / 2 + 1) cout << k << " " << x - (n + 2) / 2 << endl;
    else cout <<  k << " " << x + (n + 2) / 2 << endl;
  }
  return;
}

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int test_case = 1;
  // cin >> test_case;
  // cout << std::setprecision(15);
  while (test_case--) {
    solve();
  }
  return 0;
}
0