結果

問題 No.355 数当てゲーム(2)
ユーザー ngtkanangtkana
提出日時 2020-04-05 23:10:44
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 26 ms / 2,000 ms
コード長 1,026 bytes
コンパイル時間 2,174 ms
コンパイル使用メモリ 202,496 KB
実行使用メモリ 24,396 KB
平均クエリ数 34.48
最終ジャッジ日時 2023-09-24 02:34:21
合計ジャッジ時間 6,347 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
23,832 KB
testcase_01 AC 23 ms
24,000 KB
testcase_02 AC 20 ms
24,360 KB
testcase_03 AC 23 ms
23,676 KB
testcase_04 AC 22 ms
24,312 KB
testcase_05 AC 21 ms
23,400 KB
testcase_06 AC 21 ms
23,424 KB
testcase_07 AC 21 ms
23,676 KB
testcase_08 AC 20 ms
23,532 KB
testcase_09 AC 21 ms
23,532 KB
testcase_10 AC 21 ms
23,388 KB
testcase_11 AC 23 ms
24,396 KB
testcase_12 AC 22 ms
24,360 KB
testcase_13 AC 21 ms
23,400 KB
testcase_14 AC 22 ms
24,300 KB
testcase_15 AC 22 ms
24,024 KB
testcase_16 AC 22 ms
23,376 KB
testcase_17 AC 21 ms
24,276 KB
testcase_18 AC 23 ms
23,652 KB
testcase_19 AC 22 ms
24,180 KB
testcase_20 AC 22 ms
23,568 KB
testcase_21 AC 23 ms
23,940 KB
testcase_22 AC 21 ms
23,424 KB
testcase_23 AC 21 ms
24,024 KB
testcase_24 AC 22 ms
24,000 KB
testcase_25 AC 21 ms
24,240 KB
testcase_26 AC 22 ms
23,652 KB
testcase_27 AC 22 ms
24,240 KB
testcase_28 AC 22 ms
24,048 KB
testcase_29 AC 22 ms
23,376 KB
testcase_30 AC 22 ms
23,952 KB
testcase_31 AC 23 ms
23,556 KB
testcase_32 AC 22 ms
23,940 KB
testcase_33 AC 21 ms
23,640 KB
testcase_34 AC 21 ms
23,364 KB
testcase_35 AC 21 ms
23,844 KB
testcase_36 AC 22 ms
23,520 KB
testcase_37 AC 21 ms
23,892 KB
testcase_38 AC 20 ms
23,664 KB
testcase_39 AC 21 ms
23,520 KB
testcase_40 AC 20 ms
23,640 KB
testcase_41 AC 20 ms
23,784 KB
testcase_42 AC 21 ms
23,664 KB
testcase_43 AC 20 ms
24,000 KB
testcase_44 AC 21 ms
23,520 KB
testcase_45 AC 21 ms
23,532 KB
testcase_46 AC 22 ms
24,288 KB
testcase_47 AC 22 ms
23,532 KB
testcase_48 AC 21 ms
23,376 KB
testcase_49 AC 24 ms
24,360 KB
testcase_50 AC 22 ms
24,012 KB
testcase_51 AC 23 ms
23,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#define ALL(v) std::begin(v),std::end(v)
using lint=long long;
using lubl=long double;
lint perf,good;
std::vector<lint>now;
lint query(){
    for(lint i=0;i<4;i++){
        std::cout<<(i?" ":"")<<now.at(i);
    }
    std::cout<<std::endl;
    std::cin>>perf>>good;
    if(perf==4&&good==0)exit(0);
    return perf;
}
#define ENABLE_DEBUG 1
#ifdef NGTKANA
#include<debug.hpp>
#else
#define DEBUG(...)(void)0
#endif
int main(){
    std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false);
    std::cout.setf(std::ios_base::fixed);std::cout.precision(15);
    std::vector<lint>ans(4,-1);
    now.resize(4);
    for(lint i=0;i<2;i++){
        std::iota(ALL(now),i*5);
        lint basic=query();
        for(lint j=0;j<4;j++){
            for(lint k=!i*5;k<(!i+1)*5;k++){
                now.at(j)=k;
                if(basic<query()){
                    ans.at(j)=k;
                    break;
                }
            }
            now.at(j)=i*5+j;
        }
    }
    now=ans;
    query();
}
0