結果
| 問題 | No.253 ロウソクの長さ |
| コンテスト | |
| ユーザー |
beet
|
| 提出日時 | 2018-12-05 15:49:57 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 516 bytes |
| 記録 | |
| コンパイル時間 | 1,767 ms |
| コンパイル使用メモリ | 209,516 KB |
| 実行使用メモリ | 30,448 KB |
| 平均クエリ数 | 30.69 |
| 最終ジャッジ日時 | 2026-06-07 05:01:25 |
| 合計ジャッジ時間 | 6,862 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 36 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
//INSERT ABOVE HERE
Int ask(Int x){
static Int t = 0;
cout<<"? "<<max(0LL,x-t)<<endl;
t++;
Int res;
cin>>res;
return res<=0;
}
signed main(){
Int l=10,r=1e9+100;
while(l+1<r){
Int m=(l+r)>>1;
if(ask(m)) l=m;
else r=m;
}
cout<<"! "<<l<<endl;
return 0;
}
beet