結果

問題 No.2502 Optimization in the Dark
ユーザー i_am_noobi_am_noob
提出日時 2023-11-05 01:31:01
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 27 ms / 2,000 ms
コード長 856 bytes
コンパイル時間 2,428 ms
コンパイル使用メモリ 203,392 KB
実行使用メモリ 24,636 KB
平均クエリ数 4.00
最終ジャッジ日時 2023-11-05 01:31:09
合計ジャッジ時間 6,101 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
24,636 KB
testcase_01 AC 20 ms
24,636 KB
testcase_02 AC 21 ms
24,636 KB
testcase_03 AC 21 ms
24,636 KB
testcase_04 AC 21 ms
24,636 KB
testcase_05 AC 21 ms
24,636 KB
testcase_06 AC 24 ms
24,636 KB
testcase_07 AC 21 ms
24,636 KB
testcase_08 AC 21 ms
24,636 KB
testcase_09 AC 20 ms
24,636 KB
testcase_10 AC 21 ms
24,636 KB
testcase_11 AC 21 ms
24,636 KB
testcase_12 AC 20 ms
24,636 KB
testcase_13 AC 20 ms
24,636 KB
testcase_14 AC 21 ms
24,636 KB
testcase_15 AC 25 ms
24,636 KB
testcase_16 AC 20 ms
24,636 KB
testcase_17 AC 20 ms
24,636 KB
testcase_18 AC 24 ms
24,636 KB
testcase_19 AC 24 ms
24,636 KB
testcase_20 AC 24 ms
24,636 KB
testcase_21 AC 20 ms
24,636 KB
testcase_22 AC 19 ms
24,636 KB
testcase_23 AC 25 ms
24,636 KB
testcase_24 AC 19 ms
24,636 KB
testcase_25 AC 20 ms
24,636 KB
testcase_26 AC 21 ms
24,636 KB
testcase_27 AC 20 ms
24,636 KB
testcase_28 AC 22 ms
24,636 KB
testcase_29 AC 21 ms
24,636 KB
testcase_30 AC 21 ms
24,636 KB
testcase_31 AC 21 ms
24,636 KB
testcase_32 AC 20 ms
24,636 KB
testcase_33 AC 21 ms
24,636 KB
testcase_34 AC 20 ms
24,636 KB
testcase_35 AC 25 ms
24,636 KB
testcase_36 AC 22 ms
24,636 KB
testcase_37 AC 20 ms
24,636 KB
testcase_38 AC 21 ms
24,636 KB
testcase_39 AC 21 ms
24,636 KB
testcase_40 AC 20 ms
24,636 KB
testcase_41 AC 20 ms
24,636 KB
testcase_42 AC 20 ms
24,636 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using pii=pair<int,int>;

#define all(a) a.begin(),a.end()
#define pb push_back
#define sz(a) ((int)a.size())

signed main(){
    ios_base::sync_with_stdio(0),cin.tie(0);
    int n; cin >> n;
    int id=1,id2,id3;
    for(int i: {2,3}){
        cout << "? " << id << ' ' << 2*n << ' ' << i << ' ' << 2*n << endl;
        string s; cin >> s;
        if(s=="Yes") id=i;
    }
    id2=id+1;
    if(id2>3) id2-=3;
    id3=id2+1;
    if(id3>3) id3-=3;
    cout << "? " << id2 << ' ' << n << ' ' << id3 << ' ' << n << endl;
    string s; cin >> s;
    if(s=="No") swap(id2,id3);
    cout << "! ";
    for(int i=0; i<n; ++i) cout << id << ' ' << id3 << ' ';
    for(int i=0; i<n; ++i) cout << id << ' ' << id2 << ' ';
    for(int i=0; i<n; ++i) cout << id2 << ' ' << id3 << ' ';
    cout << endl;
}
0