結果
問題 | No.513 宝探し2 |
ユーザー |
![]() |
提出日時 | 2017-05-05 22:47:11 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,194 bytes |
コンパイル時間 | 1,689 ms |
コンパイル使用メモリ | 168,072 KB |
実行使用メモリ | 25,604 KB |
平均クエリ数 | 84.42 |
最終ジャッジ日時 | 2024-07-16 13:01:30 |
合計ジャッジ時間 | 4,222 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 3 WA * 9 |
ソースコード
#include <bits/stdc++.h>using namespace std;#define rep(i,n) REP(i,0,n)#define REP(i,s,e) for(int i=(s); i<(int)(e); i++)#define pb push_back#define all(r) r.begin(),r.end()#define rall(r) r.rbegin(),r.rend()#define fi first#define se secondtypedef long long ll;typedef vector<int> vi;typedef vector<ll> vl;typedef pair<int, int> pii;typedef pair<ll, ll> pll;const int INF = 1e9;const ll MOD = 1e9 + 7;double EPS = 1e-8;int main(){int lx=-10, rx = 100010;rep(i, 24) {int mx1 = lx +(rx-lx)/3, mx2 = lx +(rx-lx)*2/3;int d1, d2;cout << mx1 << " " << 0 << endl;cin >> d1;if(d1 == 0) return 0;cout << mx2 << " " << 0 << endl;cin >> d2;if(d2 == 0) return 0;if(d1 < d2) rx = mx2;else lx = mx1;}int x;{int d1,d2;cout << lx <<" " << 0 << endl;cin >> d1;cout << rx << " " << 0 << endl;cin >> d2;x = (d1 < d2 ? lx : rx);}int ly = -10, ry = 100010;rep(i, 24) {int my1 = ly +(ry-ly)/3, my2 = ly +(ry-ly)*2/3;int d1, d2;cout << x <<" " << my1 << endl;cin >> d1;if(d1 == 0) return 0;cout << x <<" " << my2 << endl;cin >> d2;if(d2 == 0) return 0;if(d1 < d2) ry = my2;else ly = my1;}}