結果

問題 No.305 鍵(2)
ユーザー tottoripapertottoripaper
提出日時 2018-01-07 02:12:11
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 817 bytes
コンパイル時間 598 ms
コンパイル使用メモリ 67,072 KB
実行使用メモリ 24,264 KB
平均クエリ数 157.62
最終ジャッジ日時 2023-09-23 15:35:56
合計ジャッジ時間 2,092 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
23,376 KB
testcase_01 AC 31 ms
23,520 KB
testcase_02 AC 29 ms
24,012 KB
testcase_03 AC 30 ms
24,036 KB
testcase_04 AC 30 ms
24,264 KB
testcase_05 AC 31 ms
23,508 KB
testcase_06 WA -
testcase_07 AC 29 ms
24,192 KB
testcase_08 AC 31 ms
24,048 KB
testcase_09 AC 30 ms
24,012 KB
testcase_10 AC 30 ms
23,628 KB
testcase_11 AC 30 ms
24,240 KB
testcase_12 AC 30 ms
23,988 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <tuple>
using namespace std;

char S[100];

int ask(){
    std::cout << S << std::endl;

    int N;
    std::string T;
    std::cin >> N >> T;

    return N;
}

int main(){
    for(int i=0;i<10;++i){
        S[i] = '0';
    }
    
    for(int i=0;i<10;++i){
        int x = -1, n = 100;
        for(int j=0;j<10;++j){
            for(int k=i+1;k<10;++k){
                S[k] = '0' + j;
            }

            int m = ask();
            if(m < n){
                x = j;
                n = m;
            }
        }

        for(int j=i+1;j<10;++j){
            S[j] = '0' + x;
        }

        for(int j=0;j<10;++j){
            S[i] = '0' + j;
            if(ask() == i + 1){
                break;
            }
        }
    }
}
0