結果

問題 No.305 鍵(2)
ユーザー face4face4
提出日時 2018-06-03 14:17:16
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 626 bytes
コンパイル時間 481 ms
コンパイル使用メモリ 64,928 KB
実行使用メモリ 24,456 KB
平均クエリ数 91.77
最終ジャッジ日時 2023-09-23 16:04:23
合計ジャッジ時間 3,483 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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'+j)%10;
            key[i] = (char)('0'+nextnum);
            cout << key << endl << flush;
            cin >> judgeN >> judgeS;
            if(judgeS == "unlocked")    exit(0);

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