結果

問題 No.2502 Optimization in the Dark
ユーザー RubikunRubikun
提出日時 2023-10-13 21:31:11
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,387 bytes
コンパイル時間 2,275 ms
コンパイル使用メモリ 205,224 KB
実行使用メモリ 24,384 KB
平均クエリ数 4.00
最終ジャッジ日時 2023-10-13 21:31:17
合計ジャッジ時間 6,300 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
23,616 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 27 ms
23,424 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 26 ms
23,988 KB
testcase_07 AC 27 ms
23,580 KB
testcase_08 AC 27 ms
24,348 KB
testcase_09 WA -
testcase_10 AC 27 ms
24,000 KB
testcase_11 AC 26 ms
24,324 KB
testcase_12 AC 27 ms
24,012 KB
testcase_13 AC 27 ms
23,388 KB
testcase_14 AC 26 ms
23,352 KB
testcase_15 AC 27 ms
24,264 KB
testcase_16 WA -
testcase_17 AC 27 ms
23,820 KB
testcase_18 AC 26 ms
23,988 KB
testcase_19 AC 26 ms
24,012 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 26 ms
23,796 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 27 ms
23,988 KB
testcase_26 AC 27 ms
23,988 KB
testcase_27 AC 27 ms
23,316 KB
testcase_28 AC 26 ms
23,616 KB
testcase_29 AC 26 ms
23,808 KB
testcase_30 AC 27 ms
23,616 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 26 ms
23,988 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 26 ms
23,568 KB
testcase_37 WA -
testcase_38 WA -
testcase_39 AC 26 ms
23,976 KB
testcase_40 WA -
testcase_41 WA -
testcase_42 AC 27 ms
24,024 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define mp make_pair
#define si(x) int(x.size())
const int mod=998244353,MAX=300005,INF=1<<30;

int main(){
    
    int N;cin>>N;
    vector<pair<int,int>> ask;
    vector<int> res;
    
    for(int a=1;a<=3;a++){
        for(int b=a+1;b<=3;b++){
            cout<<"?"<<" "<<a<<" "<<2*N<<" "<<b<<" "<<2*N<<endl;
            string S;cin>>S;
            ask.push_back(mp(a-1,b-1));
            if(S=="Yes") res.push_back(1);
            else res.push_back(0);
        }
    }
    
    vector<int> P={1,2,3};
    
    do{
        bool ok=true;
        for(int t=0;t<3;t++){
            if(res[t]==1){
                ok&=(P[ask[t].fi]<P[ask[t].se]);
            }else{
                ok&=(P[ask[t].fi]>=P[ask[t].se]);
            }
        }
        
        if(!ok) continue;
        
        cout<<"!";
        for(int i=1;i<=N;i++) cout<<" "<<P[1]<<" "<<P[2];
        for(int i=1;i<=N;i++) cout<<" "<<P[0]<<" "<<P[2];
        for(int i=1;i<=N;i++) cout<<" "<<P[0]<<" "<<P[1];
        cout<<endl;
        return 0;
    }while(next_permutation(all(P)));
}
0