結果

問題 No.1149 色塗りゲーム
コンテスト
ユーザー magsta
提出日時 2021-06-12 14:21:00
言語 C++14
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 84 ms / 2,000 ms
+ 0µs
コード長 630 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 904 ms
コンパイル使用メモリ 181,052 KB
実行使用メモリ 9,520 KB
平均クエリ数 19.82
最終ジャッジ日時 2026-08-15 11:28:01
合計ジャッジ時間 5,085 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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

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