結果

問題 No.305 鍵(2)
ユーザー なおなお
提出日時 2015-12-21 13:32:37
言語 C++11
(gcc 11.4.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 838 bytes
コンパイル時間 1,489 ms
コンパイル使用メモリ 147,040 KB
実行使用メモリ 24,540 KB
平均クエリ数 18.23
最終ジャッジ日時 2023-09-23 08:20:06
合計ジャッジ時間 4,402 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 26 ms
23,652 KB
testcase_06 AC 26 ms
23,700 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> VI;
#define REP(i, n) for(int(i)=0;(i)<(n);++(i))
#define in(T,V) T V;cin>>V;
const int MOD = int(1e9+7);

int check(int n[10]){
    string s;
    REP(i,10){
        if(n[i] < 0) s += "-";
        else s += char('0' + n[i]);
    }
    cout << s << endl;
    getline(cin, s);
    stringstream ss(s);
    int v; ss >> v;
    return v;
}

int main(){
    int n[10],b[10];
    REP(i,10){
        REP(j,10) n[j] = i;
        b[i] = check(n);
        if(b[i] == 10) return 0;
    }

    REP(i,10) n[i] = -1;
    int r = 0;
    REP(i,10){
        REP(j,10){
            if(b[j] == 0) continue;
            n[i] = j;
            int v = check(n);
            if(r < v){
                r = v; b[j]--;
                break;
            }
        }
    }


}
0