結果
| 問題 | No.253 ロウソクの長さ |
| コンテスト | |
| ユーザー |
beet
|
| 提出日時 | 2018-12-05 15:49:57 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 516 bytes |
| 記録 | |
| コンパイル時間 | 1,983 ms |
| コンパイル使用メモリ | 193,852 KB |
| 最終ジャッジ日時 | 2025-01-06 18:16:33 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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