結果

問題 No.1149 色塗りゲーム
ユーザー 東前頭十一枚目
提出日時 2020-08-07 22:03:13
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 132 ms / 2,000 ms
コード長 408 bytes
コンパイル時間 2,083 ms
コンパイル使用メモリ 191,636 KB
最終ジャッジ日時 2025-01-12 16:54:31
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
	int n; cin >> n;
	if(n % 2 == 1) {
		cout << 1 << " " << n / 2 + 1 << '\n';
	} else {
		cout << 2 << " " << n / 2 << '\n';
	}
	cout.flush();
	while(true) {
		int t; cin >> t;
		if(t != 3) {
			return 0;
		}
		int k, x; cin >> k >> x;
		int a = n + 1 - x;
		if(k == 2) {
			--a;
		}
		cout << k << " " << a << '\n';
		cout.flush();
	}
	return 0;
}
0