結果

問題 No.2502 Optimization in the Dark
ユーザー baluteshihbaluteshih
提出日時 2023-10-13 22:22:02
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 35 ms / 2,000 ms
コード長 986 bytes
コンパイル時間 1,951 ms
コンパイル使用メモリ 198,632 KB
実行使用メモリ 24,300 KB
平均クエリ数 4.00
最終ジャッジ日時 2023-10-13 22:22:08
合計ジャッジ時間 5,861 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
23,940 KB
testcase_01 AC 26 ms
23,784 KB
testcase_02 AC 25 ms
24,180 KB
testcase_03 AC 26 ms
23,448 KB
testcase_04 AC 25 ms
23,328 KB
testcase_05 AC 24 ms
24,192 KB
testcase_06 AC 26 ms
23,916 KB
testcase_07 AC 25 ms
23,364 KB
testcase_08 AC 26 ms
24,204 KB
testcase_09 AC 25 ms
24,252 KB
testcase_10 AC 26 ms
24,000 KB
testcase_11 AC 25 ms
23,400 KB
testcase_12 AC 26 ms
24,276 KB
testcase_13 AC 25 ms
23,796 KB
testcase_14 AC 26 ms
23,928 KB
testcase_15 AC 24 ms
23,952 KB
testcase_16 AC 25 ms
23,340 KB
testcase_17 AC 25 ms
23,388 KB
testcase_18 AC 26 ms
23,496 KB
testcase_19 AC 24 ms
24,060 KB
testcase_20 AC 24 ms
23,364 KB
testcase_21 AC 25 ms
23,988 KB
testcase_22 AC 27 ms
23,952 KB
testcase_23 AC 26 ms
23,544 KB
testcase_24 AC 25 ms
23,532 KB
testcase_25 AC 25 ms
23,424 KB
testcase_26 AC 24 ms
23,664 KB
testcase_27 AC 24 ms
23,616 KB
testcase_28 AC 26 ms
24,084 KB
testcase_29 AC 25 ms
24,000 KB
testcase_30 AC 26 ms
23,340 KB
testcase_31 AC 25 ms
23,784 KB
testcase_32 AC 25 ms
24,300 KB
testcase_33 AC 26 ms
23,580 KB
testcase_34 AC 25 ms
23,964 KB
testcase_35 AC 25 ms
23,664 KB
testcase_36 AC 25 ms
23,376 KB
testcase_37 AC 25 ms
23,340 KB
testcase_38 AC 25 ms
23,484 KB
testcase_39 AC 25 ms
23,988 KB
testcase_40 AC 25 ms
23,844 KB
testcase_41 AC 26 ms
23,412 KB
testcase_42 AC 26 ms
23,556 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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_back

int 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];
    for (int i = 0; i < n; ++i)
        cout << " " << arr[0] << " " << arr[2];
    for (int i = n + 1; i <= 2 * n; ++i)
        cout << " " << arr[0] << " " << arr[1];
    cout << endl;
}
0