結果
問題 | No.513 宝探し2 |
ユーザー |
![]() |
提出日時 | 2017-05-05 22:50:17 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,212 bytes |
コンパイル時間 | 1,458 ms |
コンパイル使用メモリ | 167,580 KB |
実行使用メモリ | 25,220 KB |
平均クエリ数 | 98.00 |
最終ジャッジ日時 | 2024-07-16 13:02:35 |
合計ジャッジ時間 | 3,933 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 12 |
コンパイルメッセージ
main.cpp: In function 'int main()': main.cpp:57:29: warning: 'x' may be used uninitialized [-Wmaybe-uninitialized] 57 | cout << x <<" " << my2 << endl; | ^~~ main.cpp:37:13: note: 'x' was declared here 37 | int x; | ^
ソースコード
#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, 20) {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 d = 1e9;rep(i, 10) {cout << lx + i << " " << 0 << endl;int tmp;cin >> tmp;if(tmp < d) {d = tmp;x = lx + i;}}}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;}}