結果

問題 No.305 鍵(2)
ユーザー parukiparuki
提出日時 2016-09-23 13:47:07
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 31 ms / 2,000 ms
コード長 929 bytes
コンパイル時間 1,474 ms
コンパイル使用メモリ 165,496 KB
実行使用メモリ 24,360 KB
平均クエリ数 86.69
最終ジャッジ日時 2023-09-24 00:33:20
合計ジャッジ時間 2,715 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
23,532 KB
testcase_01 AC 27 ms
23,616 KB
testcase_02 AC 28 ms
24,000 KB
testcase_03 AC 27 ms
23,988 KB
testcase_04 AC 28 ms
23,520 KB
testcase_05 AC 27 ms
23,364 KB
testcase_06 AC 24 ms
23,520 KB
testcase_07 AC 27 ms
24,324 KB
testcase_08 AC 27 ms
23,364 KB
testcase_09 AC 26 ms
23,376 KB
testcase_10 AC 27 ms
24,360 KB
testcase_11 AC 27 ms
23,412 KB
testcase_12 AC 28 ms
24,012 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;
#define FOR(i,j,k) for(int (i)=(j);(i)<(int)(k);++(i))
#define rep(i,j) FOR(i,0,j)
#define each(x,y) for(auto &(x):(y))
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define debug(x) cout<<#x<<": "<<(x)<<endl
#define smax(x,y) (x)=max((x),(y))
#define smin(x,y) (x)=min((x),(y))
#define MEM(x,y) memset((x),(y),sizeof (x))
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ll> vll;

int query(string s){
    cout << s << endl;
    int x;
    cin >> x >> s;
    if(x == 10)exit(0);
    else return x;
}

int main(){
    string q(10, '0');
    rep(i, 10){
        int ma = -1, d = -1, x;
        rep(j, 10){
            q[i] = (char)('0' + j);
            x = query(q);
            if(x > ma){
                d = j;
                ma = x;
            }
        }
        q[i] = (char)('0' + d);
    }
}
0