結果
問題 | No.2502 Optimization in the Dark |
ユーザー |
|
提出日時 | 2023-10-13 22:13:25 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 962 bytes |
コンパイル時間 | 1,847 ms |
コンパイル使用メモリ | 195,668 KB |
最終ジャッジ日時 | 2025-02-17 07:21:00 |
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 31 WA * 12 |
ソースコード
#include <bits/stdc++.h>using namespace std;typedef long long ll;typedef pair<int, int> pii;typedef pair<ll, ll> pll;#define X first#define Y second#define SZ(a) ((int)a.size())#define ALL(v) v.begin(), v.end()#define pb push_backint query(int a, int x, int b, int y) {cout << "? " << a << " " << x << " " << b << " " << y << endl;string s;cin >> s;return s == "Yes";}int main() {ios::sync_with_stdio(0), cin.tie(0);int n;cin >> n;int arr[3] = {1, 2, 3};for (int i = 0; i < 2; ++i)if (!query(arr[i], 2 * n, arr[i + 1], 2 * n))swap(arr[i], arr[i + 1]);if (!query(arr[0], n, arr[1], n))swap(arr[0], arr[1]);cout << "!";for (int i = 0; i < n; ++i) {cout << " " << arr[1] << " " << arr[2];cout << " " << arr[0] << " " << arr[2];}for (int i = n + 1; i <= 2 * n; ++i)cout << " " << arr[0] << " " << arr[1];cout << endl;}