結果

問題 No.1149 色塗りゲーム
ユーザー yukudoyukudo
提出日時 2020-08-07 21:32:11
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,075 bytes
コンパイル時間 1,709 ms
コンパイル使用メモリ 165,344 KB
実行使用メモリ 24,528 KB
平均クエリ数 8.98
最終ジャッジ日時 2023-09-24 04:05:47
合計ジャッジ時間 6,411 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
23,892 KB
testcase_01 AC 40 ms
23,592 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 WA -
testcase_48 WA -
testcase_49 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define REP(i,n) for(int i=0,_n=(int)(n);i<_n;++i)
#define ALL(v) (v).begin(),(v).end()
#define CLR(t,v) memset(t,(v),sizeof(t))
template<class T1,class T2>ostream& operator<<(ostream& os,const pair<T1,T2>&a){return os<<"("<<a.first<<","<<a.second<< ")";}
template<class T>void pv(T a,T b){for(T i=a;i!=b;++i)cout<<(*i)<<" ";cout<<endl;}
template<class T>void chmin(T&a,const T&b){if(a>b)a=b;}
template<class T>void chmax(T&a,const T&b){if(a<b)a=b;}

ll nextLong() { ll x; scanf("%lld", &x); return x;}

pair<int,int> read() {
  int k, x; cin >> k >> x;
  return {k, x};
}

int query(int x, int k) {
  cout << k << " " << x << endl;
  int t; cin >> t;
  return t;
}



int main() {
  int N; cin >> N;

  if (N == 1) {
    query(1, 1);
    return 0;
  }
  if (N == 2) {
    query(1, 2);
    return 0;
  }

  int x = (N+1)/2;
  int t = query(x, N % 2 ? 2 : 1);
  for (; t == 3 ;) {
    auto op = read();

    int y = op.second + op.first - 1;
    x = N + 1 - y;
    t = query(x, op.first);
  }

  return 0;
}
0