結果
問題 |
No.2502 Optimization in the Dark
|
ユーザー |
|
提出日時 | 2023-10-13 22:38:22 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,235 bytes |
コンパイル時間 | 1,894 ms |
コンパイル使用メモリ | 195,904 KB |
最終ジャッジ日時 | 2025-02-17 07:24:52 |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 43 |
ソースコード
#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 << ' ' << 1 << ' ' << 2; cout << ' ' << 2 << ' ' << 3; cout << ' ' << 1 << ' ' << 3; } if(pb == 1) { cout << ' ' << 2 << ' ' << 3; } if(pb == 2) { cout << ' ' << 1 << ' ' << 3; } if(pb == 3) { cout << ' ' << 1 << ' ' << 2; } cout << ' ' << pa << ' ' << pb << ' ' << la << ' ' << lb << endl; } void ask(int x, int y) { cout << "! " << x << " " << 2 * N - 1 << " " << y << " " << 2 * N - 1 << endl; string c; cin >> c; if(c == "Yes") { solve(x, y, 6 - x - y, x); } else { solve(x, y, 6 - x - y, y); } } 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; }