結果
| 問題 | No.2502 Optimization in the Dark |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-10-13 22:50:59 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,146 bytes |
| 記録 | |
| コンパイル時間 | 1,684 ms |
| コンパイル使用メモリ | 195,836 KB |
| 最終ジャッジ日時 | 2025-02-17 07:26:58 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 31 WA * 12 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int N;
void solve(int la, int lb, int pa, int pb) {
cout << "!";
for(int i = 0; i < N - 1; i++) {
cout << ' ' << la << ' ' << 6 - la - lb;
cout << ' ' << lb << ' ' << 6 - la - lb;
}
cout << ' ' << pb << ' ' << 6 - pa - pb << ' ' << pa << ' ' << 6 - pa - pb;
for(int i = 0; i < N; i++) {
cout << ' ' << la << ' ' << lb;
}
cout << endl;
return;
}
void ask(int x, int y) {
cout << "? " << x << " " << N << " " << y << " " << N << endl;
string c;
cin >> c;
if(c == "Yes") {
solve(x, y, x, y);
} else {
solve(x, y, y, x);
}
return;
}
int main() {
cin.tie(0); cout.tie(0);
ios::sync_with_stdio(false);
cin >> N;
cout << "? 1 " << 2 * N << " 2 " << 2 * N << endl;
string a;
cin >> a;
if(a == "Yes") {
cout << "? 2 " << 2 * N << " 3 " << 2 * N << endl;
string b;
cin >> b;
if(b == "Yes") {
ask(1, 2);
} else {
ask(1, 3);
}
} else {
cout << "? 1 " << 2 * N << " 3 " << 2 * N << endl;
string b;
cin >> b;
if(b == "Yes") {
ask(1, 2);
} else {
ask(2, 3);
}
}
return 0;
}