結果

問題 No.1149 色塗りゲーム
コンテスト
ユーザー imabc
提出日時 2026-08-27 23:58:36
言語 C++23
(gcc 15.3.0 + boost 1.92.0)
コンパイル:
g++-15 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 180 ms / 2,000 ms
+ 2µs
コード長 655 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 5,024 ms
コンパイル使用メモリ 374,496 KB
実行使用メモリ 6,272 KB
平均クエリ数 19.88
最終ジャッジ日時 2026-08-27 23:58:47
合計ジャッジ時間 8,901 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
using ll=long long;
using ld=long double;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
using vl=vector<ll>;
using vvl=vector<vl>;
using vvvl=vector<vvl>;
using graph=vector<vector<int>>;
using mint=modint998244353;
const ll INF=(1ll<<61)-1;

int main(){
  ll N; cin>>N;
  if(N%2==0)cout<<2<<" "<<N/2<<endl;
  else cout<<1<<" "<<(N+1)/2<<endl;
  fflush(stdout);
  while(true){
    ll t; cin>>t;
    if(t!=3)break;
    ll k,x; cin>>k>>x;
    if(x<=N/2)cout<<k<<" "<<x+(N/2+1)<<endl;
    else cout<<k<<" "<<x-(N/2+1)<<endl;
    fflush(stdout);
  }
  return 0;
}
0