結果

問題 No.1149 色塗りゲーム
ユーザー southball02southball02
提出日時 2020-08-09 00:20:16
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 113 ms / 2,000 ms
コード長 1,458 bytes
コンパイル時間 1,936 ms
コンパイル使用メモリ 197,740 KB
実行使用メモリ 24,372 KB
平均クエリ数 19.82
最終ジャッジ日時 2023-09-24 05:26:56
合計ジャッジ時間 7,789 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 46 ms
23,640 KB
testcase_01 AC 40 ms
24,372 KB
testcase_02 AC 40 ms
24,012 KB
testcase_03 AC 42 ms
23,364 KB
testcase_04 AC 40 ms
23,604 KB
testcase_05 AC 40 ms
24,000 KB
testcase_06 AC 41 ms
24,012 KB
testcase_07 AC 41 ms
23,820 KB
testcase_08 AC 40 ms
23,412 KB
testcase_09 AC 41 ms
23,508 KB
testcase_10 AC 42 ms
23,652 KB
testcase_11 AC 42 ms
24,012 KB
testcase_12 AC 41 ms
24,012 KB
testcase_13 AC 41 ms
24,372 KB
testcase_14 AC 42 ms
23,640 KB
testcase_15 AC 42 ms
23,820 KB
testcase_16 AC 41 ms
24,252 KB
testcase_17 AC 43 ms
23,424 KB
testcase_18 AC 43 ms
24,024 KB
testcase_19 AC 43 ms
23,412 KB
testcase_20 AC 44 ms
24,012 KB
testcase_21 AC 43 ms
23,412 KB
testcase_22 AC 43 ms
24,264 KB
testcase_23 AC 44 ms
23,400 KB
testcase_24 AC 44 ms
24,012 KB
testcase_25 AC 45 ms
23,376 KB
testcase_26 AC 44 ms
24,360 KB
testcase_27 AC 45 ms
23,664 KB
testcase_28 AC 45 ms
24,012 KB
testcase_29 AC 45 ms
23,616 KB
testcase_30 AC 84 ms
23,628 KB
testcase_31 AC 78 ms
23,652 KB
testcase_32 AC 81 ms
24,264 KB
testcase_33 AC 84 ms
24,024 KB
testcase_34 AC 87 ms
23,640 KB
testcase_35 AC 82 ms
24,000 KB
testcase_36 AC 89 ms
23,664 KB
testcase_37 AC 91 ms
23,640 KB
testcase_38 AC 86 ms
24,012 KB
testcase_39 AC 91 ms
24,012 KB
testcase_40 AC 97 ms
23,628 KB
testcase_41 AC 95 ms
24,360 KB
testcase_42 AC 93 ms
24,336 KB
testcase_43 AC 92 ms
24,372 KB
testcase_44 AC 101 ms
23,520 KB
testcase_45 AC 101 ms
24,348 KB
testcase_46 AC 102 ms
23,352 KB
testcase_47 AC 109 ms
24,336 KB
testcase_48 AC 109 ms
23,388 KB
testcase_49 AC 113 ms
23,664 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#ifndef _TEMPLATE_ROOT
#define _TEMPLATE_ROOT
#include "bits/stdc++.h"
using namespace std;
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define repl(i, a, b) for(ll i = a; i < (b); ++i)
#define repd(i, a, b) for(int i = b; i >= (a); --i)
#define repdl(i, a, b) for(ll i = b; i >= (a); --i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
template<typename H> bool chmin(H& v1, const H v2) { if (v1 > v2) { v1 = v2; return true; } return false; }
template<typename H> bool chmax(H& v1, const H v2) { if (v1 < v2) { v1 = v2; return true; } return false; }
#endif
#ifndef _TEMPLATE_IO
#define _TEMPLATE_IO

template<typename H> void read(H& head) { cin >> head; }
template<typename H, typename ...T> void read(H& head, T& ...tail) { cin >> head; read(tail...); }
template<typename H> void write(H head) { cout << head << '\n'; }
template<typename H, typename ...T> void write(H head, T ...tail) { cout << head << " "; write(tail...); }
template<typename ...T> void die(T ...tok) { write(tok...); exit(0); }
#endif
using namespace std;

int main() {
	cin.tie(0)->sync_with_stdio(0);
	cin.exceptions(cin.failbit);

  int n; read(n);
  if (n % 2 == 1) {
    write(1, (n + 1) / 2);
  } else {
    write(2, n / 2);
  }

  cout << flush;

  int t; cin >> t;

  while (t != 0) {
    int k, x; read(k, x);
    write(k, n + 2 - x - k);
    cout << flush;
    cin >> t;
  }
}

0