結果

問題 No.305 鍵(2)
ユーザー BantakoBantako
提出日時 2017-08-23 13:16:56
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 27 ms / 2,000 ms
コード長 678 bytes
コンパイル時間 1,452 ms
コンパイル使用メモリ 164,380 KB
実行使用メモリ 24,240 KB
平均クエリ数 44.08
最終ジャッジ日時 2023-09-24 01:31:18
合計ジャッジ時間 2,571 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
24,240 KB
testcase_01 AC 24 ms
23,460 KB
testcase_02 AC 22 ms
23,856 KB
testcase_03 AC 23 ms
23,964 KB
testcase_04 AC 25 ms
23,472 KB
testcase_05 AC 25 ms
23,976 KB
testcase_06 AC 23 ms
23,688 KB
testcase_07 AC 24 ms
23,748 KB
testcase_08 AC 24 ms
23,316 KB
testcase_09 AC 27 ms
23,448 KB
testcase_10 AC 26 ms
23,952 KB
testcase_11 AC 25 ms
23,340 KB
testcase_12 AC 24 ms
23,436 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:6:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type]
    6 | main(){
      | ^~~~

ソースコード

diff #

#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int INF = 1e9;
int MOD = 1e9+7;
main(){
    string key = "0000000000",ans;
    int max,n;
    cout << key << endl;
    fflush(0);
    cin >> max >> ans;
    if(ans == "unlocked")return 0;
    for(int i = 0;i < 10;i++){
        for(int j = 1;j < 10;j++){
            key[i] = j + '0';
            cout << key << endl;
            fflush(0);
            cin >> n >> ans;
            if(ans == "unlocked")return 0;
            if(n > max){
                max = n;
                break;
            }
            if(n < max){
                key[i] = '0';
                break;
            }
        }
    }
}   
0