結果
問題 | No.514 宝探し3 |
ユーザー | anta |
提出日時 | 2017-05-05 22:37:22 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 25 ms / 2,000 ms |
コード長 | 855 bytes |
コンパイル時間 | 1,262 ms |
コンパイル使用メモリ | 163,576 KB |
実行使用メモリ | 24,360 KB |
平均クエリ数 | 3.00 |
最終ジャッジ日時 | 2023-09-23 13:19:57 |
合計ジャッジ時間 | 2,442 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge11 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 25 ms
23,532 KB |
testcase_01 | AC | 19 ms
23,640 KB |
testcase_02 | AC | 21 ms
23,808 KB |
testcase_03 | AC | 20 ms
24,228 KB |
testcase_04 | AC | 20 ms
24,000 KB |
testcase_05 | AC | 21 ms
23,616 KB |
testcase_06 | AC | 22 ms
24,144 KB |
testcase_07 | AC | 22 ms
24,000 KB |
testcase_08 | AC | 22 ms
23,604 KB |
testcase_09 | AC | 23 ms
24,132 KB |
testcase_10 | AC | 23 ms
24,360 KB |
testcase_11 | AC | 23 ms
24,336 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; }