結果

問題 No.305 鍵(2)
ユーザー tetsuzuki1115tetsuzuki1115
提出日時 2018-02-23 20:31:59
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 799 bytes
コンパイル時間 674 ms
コンパイル使用メモリ 82,076 KB
実行使用メモリ 24,336 KB
平均クエリ数 92.38
最終ジャッジ日時 2023-09-23 15:49:13
合計ジャッジ時間 3,894 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 24 ms
23,532 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: 関数 ‘int main()’ 内:
main.cpp:37:22: 警告: ‘a’ may be used uninitialized [-Wmaybe-uninitialized]
   37 |         ans[i] = '0' + a;
      |                  ~~~~^~~
main.cpp:23:13: 備考: ‘a’ はここで定義されています
   23 |         int a;
      |             ^

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <math.h>
#include <cmath>
#include <limits.h>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <functional>
#include <stdio.h>
using namespace std;

long long MOD = 1000000007;

int main() {
    
    string ans = "0000000000";
    for ( int i = 0; i < 10; i++) {
        int xm = INT_MAX;
        int a;
        for ( int j = 0; j < 10; j++) {
            ans[i] = '0' + j;
            cout << ans << endl;
            int x;
            cin >> x;
            string s;
            cin >> s;
            if ( s == "unlocked" ) { return 0; }
            if ( xm > x ) {
                xm = x;
                a = j;
            }
        }
        ans[i] = '0' + a;
    }
    return 0;
}
0