結果
| 問題 | No.253 ロウソクの長さ | 
| コンテスト | |
| ユーザー |  izuru_matsuura | 
| 提出日時 | 2016-09-27 21:26:13 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                TLE
                                 
                            (最新) 
                                AC
                                 
                            (最初) | 
| 実行時間 | - | 
| コード長 | 1,111 bytes | 
| コンパイル時間 | 1,487 ms | 
| コンパイル使用メモリ | 167,400 KB | 
| 実行使用メモリ | 40,400 KB | 
| 最終ジャッジ日時 | 2024-07-17 00:26:43 | 
| 合計ジャッジ時間 | 7,952 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | TLE * 1 -- * 35 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
namespace {
    typedef double real;
    typedef long long ll;
    template<class T> ostream& operator<<(ostream& os, const vector<T>& vs) {
        if (vs.empty()) return os << "[]";
        auto i = vs.begin();
        os << "[" << *i;
        for (++i; i != vs.end(); ++i) os << " " << *i;
        return os << "]";
    }
    template<class T> istream& operator>>(istream& is, vector<T>& vs) {
        for (auto it = vs.begin(); it != vs.end(); it++) is >> *it;
        return is;
    }
    void input() {
    }
    void solve() {
        int lb = 10, ub = int(1e9) + 1;
        while (true) {
            int mid = lb + (ub - lb) / 2;
            cout << "? " << mid << endl;
            int y; cin >> y;
            if (y < 0) {
                ub = mid;
                lb--;
            } else if (y == 0) {
                cout << "! " << max(0, mid - 1) << endl;
                return;
            } else {
                assert(y > 0);
                lb = mid;
            }
        }
    }
}
int main() {
    input(); solve();
    return 0;
}
            
            
            
        