結果

問題 No.355 数当てゲーム(2)
ユーザー t98slidert98slider
提出日時 2023-03-08 15:13:33
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 29 ms / 2,000 ms
コード長 1,004 bytes
コンパイル時間 2,046 ms
コンパイル使用メモリ 183,612 KB
実行使用メモリ 24,708 KB
平均クエリ数 43.13
最終ジャッジ日時 2023-10-18 05:55:49
合計ジャッジ時間 5,876 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    vector<int> a(4);
    int S = 15;
    a = {0, 1, 2, 3};
    auto ask = [&](vector<int> a){
        int X, Y;
        for(int i = 0; i < 4; i++){
            for(int j = 0; j < i; j++){
                if(a[i] == a[j])return make_pair(5, 5);
            }
        }
        cout << a[0] << ' ' << a[1] << ' ' << a[2] << ' ' << a[3] << endl;
        cin >> X >> Y;
        if(X == 4 && Y == 0)exit(0);
        return make_pair(X, Y);
    };

    for(int i = 0; i < 4; i++){
        vector<pair<pair<int,int>, vector<int>>> b;
        for(int j = 0; j < 10; j++){
            a[i] = j;
            b.emplace_back(ask(a), a);
        }
        sort(b.begin(), b.end());
        a = b[0].second;
    }
    
    for(int i = 0; i < 4; i++){
        for(int j = 0; j < 10; j++){
            a[i] = j;
            auto temp = ask(a);
            if(temp == make_pair(i + 1, 0))break;
        }
    }
}
0