結果

問題 No.305 鍵(2)
ユーザー tubo28tubo28
提出日時 2015-11-27 22:55:50
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 27 ms / 2,000 ms
コード長 2,252 bytes
コンパイル時間 1,071 ms
コンパイル使用メモリ 144,212 KB
実行使用メモリ 24,300 KB
平均クエリ数 81.77
最終ジャッジ日時 2023-09-23 22:05:54
合計ジャッジ時間 2,383 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
23,436 KB
testcase_01 AC 25 ms
24,012 KB
testcase_02 AC 27 ms
23,532 KB
testcase_03 AC 26 ms
23,916 KB
testcase_04 AC 26 ms
23,388 KB
testcase_05 AC 26 ms
24,300 KB
testcase_06 AC 24 ms
23,448 KB
testcase_07 AC 26 ms
23,364 KB
testcase_08 AC 26 ms
23,652 KB
testcase_09 AC 27 ms
23,328 KB
testcase_10 AC 26 ms
23,904 KB
testcase_11 AC 27 ms
23,424 KB
testcase_12 AC 27 ms
23,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _CRT_SECURE_NO_WARNINGS
// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
template<class T> ostream &operator << (ostream &os, const vector<T> &);
template<size_t n, class...T> typename enable_if<(n>=sizeof...(T))>::type _ot(ostream &, const tuple<T...> &){}
template<size_t n, class...T> typename enable_if<(n< sizeof...(T))>::type _ot(ostream &os, const tuple<T...> &t){
    os << (n == 0 ? "" : " ") << get<n>(t); _ot<n+1>(os, t);
}
template<class...T> ostream &operator << (ostream &os, const tuple<T...> &t){
    _ot<0>(os, t); return os;
}
template<class T, class U> ostream & operator << (ostream &os, const pair<T,U> &p){
    return os << "(" << p.first << ", " << p.second << ") ";
}
template<class T> ostream &operator << (ostream &os, const vector<T> &v){
    for(size_t i = 0; i < v.size(); i++) os << v[i] << (i + 1 == v.size() ? "" : ", "); return os;
}
#ifdef DEBUG
#define dump(...) (cerr << #__VA_ARGS__ << " = " << make_tuple(__VA_ARGS__) \
                   << " (L : " << __LINE__ << ")" << endl)
#else
#define dump(...)
#endif
#define all(c) begin(c), end(c)
#define range(i,a,b) for(int i = a; i < (int)(b); i++)
#define rep(i,b) range(i,0,b)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
typedef long long ll;
// #define int ll
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
void fastios(){ ios_base::sync_with_stdio(0); cin.tie(0); }
int const mod = 1000000007;
auto const inf = numeric_limits<int>::max()/8;

ll r(){
    return (ll)rand()*100 + rand();
}

int query(ll n){
    printf("%010lld", n);
    cout << endl;
    int hit;
    string s;
    cin >> hit >> s;
    return hit;
}

int main(){
    while(1){
        ll dig = 1;

        ll best = 0;
        int best_hit = query(best);
        if(best_hit == 10) exit(0);
        rep(i,10){
            ll cur = best;
            rep(j,10){
                auto hit = query(cur + dig*j);
                if(hit == 10) exit(0);
                if(best_hit < hit){
                    best_hit = hit;
                    best = cur + dig*j;
                }
                dump(best, best_hit);
            }
            cur = best;
            dig *= 10;
        }
    }
}
0