結果

問題 No.2502 Optimization in the Dark
ユーザー keisuke6keisuke6
提出日時 2023-10-13 21:40:27
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 29 ms / 2,000 ms
コード長 874 bytes
コンパイル時間 2,046 ms
コンパイル使用メモリ 206,944 KB
実行使用メモリ 24,468 KB
平均クエリ数 4.00
最終ジャッジ日時 2023-10-13 21:40:35
合計ジャッジ時間 5,389 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
23,412 KB
testcase_01 AC 23 ms
23,520 KB
testcase_02 AC 23 ms
24,336 KB
testcase_03 AC 23 ms
24,048 KB
testcase_04 AC 24 ms
23,544 KB
testcase_05 AC 23 ms
24,348 KB
testcase_06 AC 25 ms
24,468 KB
testcase_07 AC 23 ms
23,676 KB
testcase_08 AC 23 ms
24,036 KB
testcase_09 AC 23 ms
24,048 KB
testcase_10 AC 23 ms
23,388 KB
testcase_11 AC 24 ms
23,388 KB
testcase_12 AC 24 ms
23,376 KB
testcase_13 AC 23 ms
23,808 KB
testcase_14 AC 27 ms
23,376 KB
testcase_15 AC 26 ms
23,976 KB
testcase_16 AC 25 ms
23,364 KB
testcase_17 AC 26 ms
24,000 KB
testcase_18 AC 26 ms
23,820 KB
testcase_19 AC 25 ms
23,388 KB
testcase_20 AC 25 ms
23,616 KB
testcase_21 AC 23 ms
23,688 KB
testcase_22 AC 23 ms
23,412 KB
testcase_23 AC 23 ms
24,288 KB
testcase_24 AC 23 ms
23,688 KB
testcase_25 AC 23 ms
24,372 KB
testcase_26 AC 23 ms
23,400 KB
testcase_27 AC 23 ms
23,988 KB
testcase_28 AC 24 ms
23,976 KB
testcase_29 AC 23 ms
24,324 KB
testcase_30 AC 22 ms
24,048 KB
testcase_31 AC 23 ms
23,412 KB
testcase_32 AC 23 ms
23,556 KB
testcase_33 AC 23 ms
24,348 KB
testcase_34 AC 23 ms
24,060 KB
testcase_35 AC 23 ms
23,616 KB
testcase_36 AC 29 ms
23,388 KB
testcase_37 AC 24 ms
24,264 KB
testcase_38 AC 24 ms
23,376 KB
testcase_39 AC 22 ms
24,036 KB
testcase_40 AC 24 ms
24,396 KB
testcase_41 AC 22 ms
24,024 KB
testcase_42 AC 24 ms
24,216 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define int long long
int mod = 998244353;
signed main(){
    int N;
    cin>>N;
    int a = 1;
    cout<<'?'<<' '<<1<<' '<<2*N<<' '<<2<<' '<<2*N<<endl;
    string s;
    cin>>s;
    a = (s == "No" ? 1 : 2);
    cout<<'?'<<' '<<a<<' '<<2*N<<' '<<3<<' '<<2*N<<endl;
    cin>>s;
    a = (s == "No" ? a : 3);
    set<int> st;
    st.insert(1);
    st.insert(2);
    st.insert(3);
    st.erase(a);
    cout<<'?'<<' '<<(*st.begin())<<' '<<N<<' '<<(*st.rbegin())<<' '<<N<<endl;
    cin>>s;
    int c = (s == "Yes" ? (*st.rbegin()) : (*st.begin()));
    int b = (s == "Yes" ? (*st.begin()) : (*st.rbegin()));
    cout<<'!'<<' ';
    for(int i=0;i<N;i++){
    	cout<<c<<' '<<a<<' ';
    	
    }
    for(int i=0;i<N;i++){
    	cout<<b<<' '<<a<<' ';
    	
    }
    for(int i=0;i<N;i++){
    	cout<<b<<' '<<c<<' ';
    }
    cout<<endl;
}
0