結果

問題 No.305 鍵(2)
ユーザー kpinkcatkpinkcat
提出日時 2023-11-13 00:54:45
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 25 ms / 2,000 ms
コード長 1,208 bytes
コンパイル時間 2,135 ms
コンパイル使用メモリ 205,088 KB
実行使用メモリ 24,000 KB
平均クエリ数 53.92
最終ジャッジ日時 2023-11-13 00:54:49
合計ジャッジ時間 3,443 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
#include<iostream>
#include<iomanip>
#include<string>
#include<algorithm>
#include<vector>
#include<set>
#include<list>
#include<queue>
#include<math.h>
#include<bitset>
using ll = long long;
using namespace std;

int main()
{
    int q = 10, ex = 0;
    string base = "0000000000";
    vector<int> num(10), ans(10);
    while (q--){
        int ans1;
        string s = "", t;
        for (int i = 0; i < 10; i++) s += to_string(q);
        cout << s << endl;
        cin >> ans1 >> t;
        if (ans1 == 10) return 0;
        if (!ans1){
            ex = 1;
        }
        num[q] = ans1;
    }
    q = 10;
    while (q--){
        int ans1;
        string s;
        if (num[q] == 0) continue;
        for (int i = 0; i < 10; i++) {
            string base1 = base;
            if (q == 0) base1 = "1111111111";
            base1[i] = '0'+ q;
            cout << base1 << endl;
            cin >> ans1 >> s;
            if (ans1 == 10) return 0;
            if (q != 0) {
                if (ans1 == num[0]+1) ans[i] = q;
            } else {
                if (ans1 == num[1]+1) ans[i] = 0;
            }
        }
    }
    for (auto x : ans) cout << x;
    cout << endl;
}
0