結果

問題 No.355 数当てゲーム(2)
ユーザー odan3240odan3240
提出日時 2016-04-03 23:35:51
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,292 bytes
コンパイル時間 859 ms
コンパイル使用メモリ 82,776 KB
実行使用メモリ 24,468 KB
平均クエリ数 43.19
最終ジャッジ日時 2023-09-23 10:13:28
合計ジャッジ時間 6,032 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
23,616 KB
testcase_01 AC 29 ms
24,372 KB
testcase_02 AC 28 ms
23,544 KB
testcase_03 AC 29 ms
24,024 KB
testcase_04 AC 29 ms
24,372 KB
testcase_05 AC 28 ms
24,348 KB
testcase_06 WA -
testcase_07 AC 29 ms
23,712 KB
testcase_08 AC 29 ms
23,904 KB
testcase_09 AC 29 ms
23,844 KB
testcase_10 AC 29 ms
24,024 KB
testcase_11 AC 29 ms
23,664 KB
testcase_12 AC 29 ms
23,412 KB
testcase_13 WA -
testcase_14 AC 28 ms
23,772 KB
testcase_15 AC 29 ms
23,856 KB
testcase_16 AC 29 ms
24,036 KB
testcase_17 AC 28 ms
23,916 KB
testcase_18 AC 30 ms
24,060 KB
testcase_19 AC 29 ms
23,424 KB
testcase_20 WA -
testcase_21 AC 29 ms
24,024 KB
testcase_22 AC 29 ms
23,472 KB
testcase_23 AC 29 ms
23,832 KB
testcase_24 AC 30 ms
23,388 KB
testcase_25 AC 30 ms
23,640 KB
testcase_26 AC 29 ms
23,616 KB
testcase_27 AC 29 ms
24,360 KB
testcase_28 AC 29 ms
23,604 KB
testcase_29 AC 30 ms
24,288 KB
testcase_30 AC 30 ms
23,376 KB
testcase_31 AC 28 ms
23,592 KB
testcase_32 AC 29 ms
23,532 KB
testcase_33 AC 28 ms
23,844 KB
testcase_34 AC 29 ms
24,132 KB
testcase_35 WA -
testcase_36 AC 29 ms
24,456 KB
testcase_37 AC 31 ms
24,348 KB
testcase_38 AC 29 ms
23,436 KB
testcase_39 AC 28 ms
24,024 KB
testcase_40 AC 28 ms
23,544 KB
testcase_41 AC 29 ms
23,640 KB
testcase_42 AC 28 ms
23,712 KB
testcase_43 AC 28 ms
23,388 KB
testcase_44 AC 29 ms
24,132 KB
testcase_45 AC 28 ms
24,420 KB
testcase_46 AC 28 ms
24,036 KB
testcase_47 AC 29 ms
24,036 KB
testcase_48 AC 29 ms
23,400 KB
testcase_49 AC 28 ms
23,712 KB
testcase_50 AC 28 ms
23,244 KB
testcase_51 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>

using namespace std;
using ll = long long;

#define all(c) (c).begin(), (c).end()
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)
#define fr first
#define sc second

const ll INF=1e9;
const ll MOD=1e9+7;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

vector<int> ans;
pair<int,int> query(vector<int> vec) {
    rep(i,4) cout<<vec[i]<<(i==3?"\n":" ");
    cout<<flush;
    pair<int,int> ret;
    cin>>ret.first>>ret.second;
    return ret;
}
int sum(pair<int,int> p) {
    return p.first+p.second;
}
int main() {
    ans.resize(4);
    rep(i,4) ans[i]=i;
    vector<int> vec=ans;
    vec.resize(4);
    rep(i,4) {
        auto p=query(ans);
        rep(j,10) if(find(all(vec), j)==vec.end()) {
            vec[i]=j;
            auto t=query(vec);
            if(sum(t)>=sum(p)) {
                p=t;
                ans=vec;
            }
        }
        vec=ans;
    }
    sort(all(ans));
    do {
        auto p=query(ans);
        if(p.first==4) break;
    }while(std::next_permutation(all(ans)));

    return 0;
}
0