結果
問題 |
No.513 宝探し2
|
ユーザー |
![]() |
提出日時 | 2017-06-05 23:44:34 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,126 bytes |
コンパイル時間 | 598 ms |
コンパイル使用メモリ | 72,516 KB |
実行使用メモリ | 25,708 KB |
平均クエリ数 | 33.33 |
最終ジャッジ日時 | 2024-07-16 13:51:55 |
合計ジャッジ時間 | 3,989 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 1 WA * 11 |
ソースコード
#include <iostream> #include <iomanip> #include <stack> #include <queue> #include <vector> #include <algorithm> #include <map> #include <set> using namespace std; signed main(){ double in; int x = 0; int y = 0; cout << x << " " << y << endl; cin >> in; if(in == 0){ return 0; } int high = 1e6; int low = 0; while(high - low > 1){ int mid = (high + low) / 2; cout << mid << " " << y << endl; double tmp; cin >> tmp; if(tmp == 0){ return 0; } if(in > tmp){ in = tmp; low = mid; }else if(in < tmp){ high = mid; }else{ break; } } high = 1e6; low = 0; while(high - low > 1){ int mid = (high + low) / 2; cout << x << " " << mid << endl; double tmp; cin >> tmp; if(tmp == 0){ return 0; } if(in > tmp){ in = tmp; low = mid; }else if(in < tmp){ high = mid; }else{ break; } } }