Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //#define _CRT_SECURE_NO_WARNINGS
- //#pragma comment(linker,"/STACK:64000000")
- #include <stdio.h>
- #include <iostream>
- #include <math.h>
- #include <vector>
- #include <map>
- #include <set>
- #include <algorithm>
- #include <queue>
- #include <string>
- #include <string.h>
- #include <ctype.h>
- #include <iomanip>
- #include <iterator>
- #include <unordered_map>
- #include <unordered_set>
- #include <stdlib.h>
- #include <stack>
- #include <cstdio>
- #include <time.h>
- using namespace std;
- typedef long long ll;
- typedef pair<int, int> pii;
- typedef vector<int> vi;
- typedef vector<vi> vvi;
- #define all(x) x.begin(),x.end()
- #define mp make_pair
- #define eps 1e-7
- #define PI 3.14159265358979323846
- #define ACCEPTED return 0;
- #define optimize cin.sync_with_stdio(false);cout.sync_with_stdio(false);cin.tie(0);
- const ll infinity = (ll) 1e18;
- #ifdef _DEBUG
- const int maxlen = (int)(1e1) + 10;
- #else
- const int maxlen = (int)(1e5) + 10;
- #endif
- const int base = (int)(1e9);
- const ll mod = base + 7;
- #define name ""
- int main() {
- //#ifdef _DEBUG
- // freopen("input.txt", "rt", stdin);
- // freopen("output.txt", "wt", stdout);
- /*#else
- // freopen(name".in", "rt", stdin);
- // freopen(name".out", "wt", stdout);*/
- //#endif
- //optimize;
- int lx = 0, rx = maxlen, x, ans;
- while(rx - lx > 1)
- {
- x = rx+lx;
- x>>=1;
- printf("? 1 0 %d\n",x);
- fflush(stdout);
- scanf("%d",&ans);
- if(ans)
- rx = x;
- else
- lx = x;
- }
- int ly = 0, ry = maxlen, y;
- while(ry - ly > 1)
- {
- y = ry+ly;
- y>>=1;
- printf("? 0 1 %d\n",y);
- fflush(stdout);
- scanf("%d",&ans);
- if(ans)
- ry = y;
- else
- ly = y;
- }
- printf("! %d %d\n",lx,ly);
- fflush(stdout);
- ACCEPTED
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement