結果

問題 No.305 鍵(2)
ユーザー otsnskotsnsk
提出日時 2015-12-06 18:01:34
言語 C++11
(gcc 11.4.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 1,068 bytes
コンパイル時間 513 ms
コンパイル使用メモリ 71,328 KB
実行使用メモリ 24,420 KB
平均クエリ数 46.00
最終ジャッジ日時 2023-09-23 08:14:35
合計ジャッジ時間 2,042 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
24,048 KB
testcase_01 AC 26 ms
24,300 KB
testcase_02 AC 30 ms
23,652 KB
testcase_03 AC 26 ms
24,060 KB
testcase_04 AC 27 ms
23,700 KB
testcase_05 AC 28 ms
23,868 KB
testcase_06 WA -
testcase_07 AC 26 ms
24,060 KB
testcase_08 AC 26 ms
23,448 KB
testcase_09 AC 26 ms
23,856 KB
testcase_10 AC 26 ms
23,436 KB
testcase_11 AC 29 ms
24,048 KB
testcase_12 AC 25 ms
24,420 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cmath>

#define FORR(i,b,e) for(int i=(b);i<(int)(e);++i)
#define FOR(i,e) FORR(i,0,e)
#define ALL(c) begin(c), end(c)
#define dump(var) cerr << #var ": " << var << "\n"
#define dumpc(con) for(auto& e: con) cerr << e << " "; cerr<<"\n"

using namespace std;


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);


    string ans, x, res;
    int fm;

    ans = "0000000000";
    x = "0000000000";
    cout << x << endl;
    cin >> fm;
    getline(cin, res);

    FOR(i, 10) {
        FORR(j, 1, 10) {
            int m;
            x[i] = '0' + j;
            cout << x << endl;
            cin >> m;
            getline(cin, res);
            if (m == 10) {
                return 0;
            }
            else if (fm < m) {
                ans[i] = x[i];
                break;
            }
            else if (fm > m) {
                break;
            }
        }
        x[i] = '0';
    }
    cout << ans << endl;
    getline(cin, res);
    
    return 0;
}
0