結果

問題 No.1149 色塗りゲーム
ユーザー ooaiu
提出日時 2025-07-10 02:19:31
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 545 bytes
コンパイル時間 3,510 ms
コンパイル使用メモリ 272,868 KB
実行使用メモリ 26,240 KB
平均クエリ数 7.60
最終ジャッジ日時 2025-07-10 02:19:43
合計ジャッジ時間 10,639 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 2 WA * 43 RE * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int N;
int paint(int k, int x) {
	assert(1<= k && k <= 2 && 1 <= x && x <= N + 1 - k);
	cout << k << " " << x << endl;
	int t;
	cin >> t;
	return t;
}
int main() {
	std::ios_base::sync_with_stdio(false);
	std::cin.tie(nullptr);
	cin >> N;
	int t = (N & 1 ? paint(1, (N+1)/2) : paint(2, N/2));
	if(t<=1) exit(0);
	int M = (N & 1 ? N/2 : (N-2)/2);
	while(true) {
		int k, x;
		cin >> k >> x;
		if(x >= M) x -= M;
		else x += M;
		int t = paint(k, x);
		if(t <= 1) exit(0);
	}
}

0