結果

問題 No.305 鍵(2)
ユーザー face4face4
提出日時 2018-06-03 14:20:46
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 33 ms / 2,000 ms
コード長 627 bytes
コンパイル時間 1,038 ms
コンパイル使用メモリ 65,268 KB
実行使用メモリ 24,276 KB
平均クエリ数 86.46
最終ジャッジ日時 2023-09-24 01:47:43
合計ジャッジ時間 2,218 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
23,616 KB
testcase_01 AC 28 ms
23,460 KB
testcase_02 AC 29 ms
23,628 KB
testcase_03 AC 28 ms
23,988 KB
testcase_04 AC 28 ms
23,628 KB
testcase_05 AC 28 ms
24,276 KB
testcase_06 AC 24 ms
23,436 KB
testcase_07 AC 28 ms
24,000 KB
testcase_08 AC 27 ms
23,388 KB
testcase_09 AC 27 ms
23,436 KB
testcase_10 AC 28 ms
23,388 KB
testcase_11 AC 28 ms
23,352 KB
testcase_12 AC 28 ms
24,024 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
using namespace std;

int main(){
    string key = "0000000000";
    int maxscore, nextnum, judgeN;
    string tmpkey,judgeS;

    for(int i = 0; i < 10; i++){
        maxscore = -1;
        tmpkey = key;
        for(int j = 0; j < 10; j++){
            nextnum = (key[i]-'0'+1)%10;
            key[i] = (char)('0'+nextnum);
            cout << key << endl << flush;
            cin >> judgeN >> judgeS;
            if(judgeS == "unlocked")    return 0;

            if(judgeN > maxscore){
                maxscore = judgeN;
                tmpkey = key;
            }
        }
        key = tmpkey;
    }
}
0