結果
問題 | No.513 宝探し2 |
ユーザー | anta |
提出日時 | 2017-05-05 22:37:38 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 30 ms / 2,000 ms |
コード長 | 855 bytes |
コンパイル時間 | 1,380 ms |
コンパイル使用メモリ | 162,932 KB |
実行使用メモリ | 24,300 KB |
平均クエリ数 | 3.00 |
最終ジャッジ日時 | 2023-09-24 01:02:56 |
合計ジャッジ時間 | 2,603 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge12 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 30 ms
23,736 KB |
testcase_01 | AC | 26 ms
24,288 KB |
testcase_02 | AC | 26 ms
24,012 KB |
testcase_03 | AC | 26 ms
23,364 KB |
testcase_04 | AC | 25 ms
23,604 KB |
testcase_05 | AC | 25 ms
23,604 KB |
testcase_06 | AC | 25 ms
23,412 KB |
testcase_07 | AC | 25 ms
23,640 KB |
testcase_08 | AC | 25 ms
23,328 KB |
testcase_09 | AC | 23 ms
23,592 KB |
testcase_10 | AC | 24 ms
24,300 KB |
testcase_11 | AC | 24 ms
23,736 KB |
ソースコード
#include "bits/stdc++.h" using namespace std; #define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i)) #define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i)) #define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i)) static const int INF = 0x3f3f3f3f; static const long long INFL = 0x3f3f3f3f3f3f3f3fLL; typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<pair<int, int> > vpii; typedef long long ll; template<typename T, typename U> static void amin(T &x, U y) { if (y < x) x = y; } template<typename T, typename U> static void amax(T &x, U y) { if (x < y) x = y; } int query(int x, int y) { printf("%d %d\n", x, y); fflush(stdout); int d; scanf("%d", &d); return d; } int main() { const int W = 1000000000; int a = query(0, 0); int b = query(0, W); int x = (int)((ll)a + b - W) / 2; int y = a - x; query(x, y); return 0; }