結果

問題 No.2502 Optimization in the Dark
ユーザー HaaHaa
提出日時 2023-10-13 22:42:03
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,293 bytes
コンパイル時間 1,524 ms
コンパイル使用メモリ 169,504 KB
実行使用メモリ 24,432 KB
平均クエリ数 4.00
最終ジャッジ日時 2023-10-13 22:42:12
合計ジャッジ時間 5,237 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
24,000 KB
testcase_01 AC 24 ms
23,520 KB
testcase_02 AC 25 ms
23,532 KB
testcase_03 AC 25 ms
24,144 KB
testcase_04 AC 25 ms
23,904 KB
testcase_05 AC 25 ms
23,376 KB
testcase_06 AC 25 ms
23,412 KB
testcase_07 AC 26 ms
23,604 KB
testcase_08 AC 25 ms
23,904 KB
testcase_09 AC 25 ms
23,556 KB
testcase_10 AC 26 ms
23,316 KB
testcase_11 AC 24 ms
23,532 KB
testcase_12 AC 25 ms
23,724 KB
testcase_13 AC 25 ms
23,532 KB
testcase_14 AC 26 ms
24,252 KB
testcase_15 AC 25 ms
23,892 KB
testcase_16 AC 25 ms
23,268 KB
testcase_17 AC 24 ms
23,628 KB
testcase_18 AC 25 ms
23,388 KB
testcase_19 AC 25 ms
23,532 KB
testcase_20 AC 24 ms
23,592 KB
testcase_21 AC 25 ms
23,532 KB
testcase_22 AC 24 ms
23,424 KB
testcase_23 AC 25 ms
23,268 KB
testcase_24 AC 25 ms
23,916 KB
testcase_25 AC 26 ms
23,604 KB
testcase_26 AC 25 ms
23,940 KB
testcase_27 AC 25 ms
23,520 KB
testcase_28 AC 26 ms
23,904 KB
testcase_29 AC 25 ms
24,012 KB
testcase_30 AC 26 ms
23,904 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> P;
typedef vector<ll> VI;
typedef vector<VI> VVI;
#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) v.begin(),v.end()
template<typename T> bool chmax(T& x, const T& y){return (x<y)?(x=y,true):false;};
template<typename T> bool chmin(T& x, const T& y){return (x>y)?(x=y,true):false;};
constexpr ll MOD=998244353;
constexpr ll INF=2e18;

bool ask(int i, int x, int j, int y){
    cout << "? ";
    cout << i+1 << " " << x+1 << " ";
    cout << j+1 << " " << y+1 << endl;
    string ret;
    cin >> ret;
    return ret=="Yes";
}

int main(){
    int n; cin >> n;
    int mx=0;
    for(int i=1;i<=2;i++){
        if(ask(mx,n*2-1,i,n*2-1))
            mx=i;
    }
    int l=-1, r=-1;
    REP(i,3){
        if(i==mx)
            continue;
        if(l==-1)
            l=i;
        else
            r=i;
    }
    if(ask(r,n-1,l,n-1))
        swap(l,r);
    VI ansl, ansr;
    REP(i,n*2){
        ansl.push_back(mx);
        if(i%2==0)
            ansr.push_back(r);
        else
            ansr.push_back(l);
    }
    REP(i,n){
        ansl.push_back(l);
        ansr.push_back(r);
    }
    cout << "!";
    REP(i,n*3) cout << " " << ansl[i]+1 << " " << ansr[i]+1;
    cout << endl;
    return 0;
}
0