結果
問題 | No.513 宝探し2 |
ユーザー |
![]() |
提出日時 | 2017-05-05 22:44:55 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 2,613 bytes |
コンパイル時間 | 889 ms |
コンパイル使用メモリ | 99,520 KB |
実行使用メモリ | 40,396 KB |
最終ジャッジ日時 | 2024-07-17 00:58:38 |
合計ジャッジ時間 | 7,350 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | TLE * 1 -- * 11 |
ソースコード
#include <iostream>#include <iomanip>#include <cstdio>#include <string>#include <cstring>#include <deque>#include <list>#include <queue>#include <stack>#include <vector>#include <utility>#include <algorithm>#include <map>#include <set>#include <complex>#include <cmath>#include <limits>#include <cfloat>#include <climits>#include <ctime>#include <cassert>#include <numeric>using namespace std;#define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++)#define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++)#define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--)#define all(v) begin(v), end(v)#define pb(a) push_back(a)#define fr first#define sc second#define INF 2000000000#define int long long int#define X real()#define Y imag()#define EPS (1e-10)#define EQ(a,b) (abs((a) - (b)) < EPS)#define EQV(a,b) ( EQ((a).X, (b).X) && EQ((a).Y, (b).Y) )#define LE(n, m) ((n) < (m) + EPS)#define LEQ(n, m) ((n) <= (m) + EPS)#define GE(n, m) ((n) + EPS > (m))#define GEQ(n, m) ((n) + EPS >= (m))typedef vector<int> VI;typedef vector<VI> MAT;typedef pair<int, int> pii;typedef long long ll;typedef complex<double> P;typedef pair<P, P> L;typedef pair<P, double> C;int dx[]={1, -1, 0, 0};int dy[]={0, 0, 1, -1};int const MOD = 1000000007;ll mod_pow(ll x, ll n) {return (!n)?1:(mod_pow((x*x)%MOD,n/2)*((n&1)?x:1))%MOD;}int madd(int a, int b) {return (a + b) % MOD;}int msub(int a, int b) {return (a - b + MOD) % MOD;}int mmul(int a, int b) {return (a * b) % MOD;}int minv(int a) {return mod_pow(a, MOD-2);}int mdiv(int a, int b) {return mmul(a, minv(b));}namespace std {bool operator<(const P& a, const P& b) {return a.X != b.X ? a.X < b.X : a.Y < b.Y;}}signed main() {int ubx = 100010, lbx = -1, uby = 100010, lby = -1;while(ubx - lbx > 1) {int l = (2*ubx + lbx) / 3;int r = (ubx + 2*lbx) / 3;int kl, kr;cout << l << " " << 0 << endl;cin >> kl;cout << r << " " << 0 << endl;cin >> kr;if(kl < kr) {ubx = (2*ubx + lbx) / 3;}else {lbx = (ubx + 2*lbx) / 3;}}while(uby - lby > 1) {int l = (2*uby + lby) / 3;int r = (uby + 2*lby) / 3;int kl, kr;cout << lbx << " " << l << endl;cin >> kl;cout << lbx << " " << r << endl;cin >> kr;if(kl < kr) {uby = (2*uby + lby) / 3;}else {lby = (uby + 2*lby) / 3;}}int ans;cout << lbx << " " << lby << endl;cin >> ans;return 0;}