結果
問題 | No.253 ロウソクの長さ |
ユーザー | latte0119 |
提出日時 | 2015-08-06 12:55:03 |
言語 | C++11 (gcc 11.4.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 592 bytes |
コンパイル時間 | 2,699 ms |
コンパイル使用メモリ | 143,540 KB |
実行使用メモリ | 24,540 KB |
平均クエリ数 | 33.69 |
最終ジャッジ日時 | 2023-09-23 05:39:41 |
合計ジャッジ時間 | 7,275 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | AC | 27 ms
24,132 KB |
testcase_02 | AC | 28 ms
23,592 KB |
testcase_03 | AC | 26 ms
23,652 KB |
testcase_04 | AC | 27 ms
24,024 KB |
testcase_05 | AC | 27 ms
23,640 KB |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | AC | 24 ms
23,844 KB |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | AC | 25 ms
24,372 KB |
testcase_15 | WA | - |
testcase_16 | AC | 25 ms
24,108 KB |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | AC | 26 ms
23,724 KB |
testcase_20 | WA | - |
testcase_21 | AC | 26 ms
24,108 KB |
testcase_22 | AC | 26 ms
23,652 KB |
testcase_23 | WA | - |
testcase_24 | AC | 27 ms
23,628 KB |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | WA | - |
testcase_29 | WA | - |
testcase_30 | WA | - |
testcase_31 | WA | - |
testcase_32 | WA | - |
testcase_33 | WA | - |
testcase_34 | AC | 26 ms
24,120 KB |
testcase_35 | WA | - |
ソースコード
#include<bits/stdc++.h> using namespace std; int ask(int Y){ cout<<"? "<<Y<<endl; int res; cin>>res; return res; } int main(){ int x=ask(80); if(x<1){ for(int i=1;i<100;i++){ x=ask(0); if(x==0){ cout<<"! "<<i<<endl; return 0; } } } int cnt=1; int lb=80,ub=1e9+1; while(ub-lb>1){ int mid=(ub+lb)/2; x=ask(mid-cnt); if(x==1){ ub=mid; } else lb=mid; cnt++; } cout<<"! "<<lb<<endl; return 0; }