結果

問題 No.2502 Optimization in the Dark
ユーザー Carpenters-Cat
提出日時 2023-10-13 23:37:34
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 767 bytes
コンパイル時間 1,814 ms
コンパイル使用メモリ 194,456 KB
最終ジャッジ日時 2025-02-17 07:36:54
ジャッジサーバーID
(参考情報)
judge1 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 31 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main () {
	int N;
	cin >> N;
	cout << "? 1 " << N * 2 << " 2 " << N * 2 << endl;
	string s;
	cin >> s;
	int i, j, k;
	if (s == "Yes") {
		cout << "? 2 " << N * 2 << " 3 " << N * 2 << endl;
		string t;
		cin >> t;
		k = (t == "Yes" ? 3 : 2);
	} else {
		cout << "? 1 " << N * 2 << " 3 " << N * 2 << endl;
		string t;
		cin >> t;
		k = (t == "Yes" ? 3 : 1);
	}
	i = (k + 1 > 3 ? k - 2 : k + 1), j = (k + 2 > 3 ? k - 1 : k + 2);
	cout << "? " << i << " " << N << " " << j << " " << N << endl;
	cin >> s;
	if (s == "No") {
		swap(i, j);
	}
	cout << "!";
	for (int p = 0; p < N * 2; p ++) {
		cout << " " << (p & 1 ? i : j) << " " << k;
	}
	for (int p = 0; p < N; p ++) {
		cout << " " << i << " " << j;
	}
	cout<< endl;
}
0