fork download
  1.  
  2.  
  3. #pragma comment(linker, "/stack:200000000")
  4.  
  5. #pragma GCC optimize ("Ofast")
  6.  
  7. #pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
  8.  
  9. #include <bits/stdc++.h>
  10.  
  11. using namespace std;
  12.  
  13.  
  14.  
  15.  
  16.  
  17. #define TRACE
  18.  
  19.  
  20.  
  21. #ifdef TRACE
  22.  
  23. #define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
  24.  
  25. template <typename Arg1>
  26.  
  27. void __f(const char* name, Arg1&& arg1){
  28.  
  29. cerr << name << " : " << arg1 << std::endl;
  30.  
  31. }
  32.  
  33. template <typename Arg1, typename... Args>
  34.  
  35. void __f(const char* names, Arg1&& arg1, Args&&... args){
  36.  
  37. const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
  38.  
  39. }
  40.  
  41. #else
  42.  
  43. #define trace(...)
  44.  
  45. #endif
  46.  
  47.  
  48.  
  49. #define rep(i, n) for(int i = 0; i < (n); ++i)
  50.  
  51. #define repA(i, a, n) for(int i = a; i <= (n); ++i)
  52.  
  53. #define repD(i, a, n) for(int i = a; i >= (n); --i)
  54.  
  55. #define trav(a, x) for(auto& a : x)
  56.  
  57. #define all(x) x.begin(), x.end()
  58.  
  59. #define sz(x) (int)(x).size()
  60.  
  61. #define fill(a) memset(a, 0, sizeof (a))
  62.  
  63. #define fst first
  64.  
  65. #define snd second
  66.  
  67. #define mp make_pair
  68.  
  69. #define pb push_back
  70.  
  71. typedef long double ld;
  72.  
  73. typedef long long ll;
  74.  
  75. typedef pair<int, int> pii;
  76.  
  77. typedef vector<int> vi;
  78.  
  79.  
  80.  
  81. void pre(){
  82.  
  83.  
  84.  
  85.  
  86.  
  87. }
  88.  
  89. bool fg =0;
  90.  
  91. int inf = 1e9;
  92.  
  93. int q(int x,int y){
  94.  
  95. if(fg) x= inf-x,y=inf-y;
  96.  
  97. cout<<"Q "<<x<<' '<<y<<endl;
  98.  
  99. int ans;
  100.  
  101. cin>>ans;
  102.  
  103. return ans;
  104.  
  105. }
  106.  
  107. int x1,Y1,x2,y2;
  108.  
  109. void pr(){
  110.  
  111. cout<<"A "<<x1<<' '<<Y1<<' '<<inf-x2<<' '<<inf-y2<<endl;
  112.  
  113. int result;cin>>result;
  114.  
  115. if(result!=1) exit(0);
  116.  
  117. }
  118.  
  119. void solve(){
  120.  
  121. fg=0;
  122.  
  123. int xl = 0,xu = 1e9;
  124.  
  125. int y = q(0,0);
  126.  
  127. xu = min(xu,y);
  128.  
  129. while(xl<xu){
  130.  
  131. int mid = (xl+xu)/2;
  132.  
  133. mid++;
  134.  
  135. if(q(mid,0)==y-mid) xl=mid;
  136.  
  137. else xu =mid-1;
  138.  
  139. }
  140.  
  141. x1 = xl,Y1 = y-x1;
  142.  
  143. xl=0,xu=1e9,fg=1,y=q(0,0);
  144.  
  145. xu = min(xu,y);
  146.  
  147. while(xl<xu){
  148.  
  149. int mid = (xl+xu)/2;
  150.  
  151. mid++;
  152.  
  153. if(q(mid,0)==y-mid) xl=mid;
  154.  
  155. else xu =mid-1;
  156.  
  157. }
  158.  
  159. x2 = xl,y2=y-x2;
  160.  
  161. pr();
  162.  
  163. }
  164.  
  165.  
  166.  
  167. int main() {
  168.  
  169. cin.sync_with_stdio(0); cin.tie(0);
  170.  
  171. cin.exceptions(cin.failbit);
  172.  
  173. pre();
  174.  
  175. int n;cin>>n;
  176.  
  177. rep(i,n) solve();
  178.  
  179.  
  180.  
  181. return 0;
  182.  
  183. }
  184.  
  185.  
  186.  
  187.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:13:1: error: stray ‘\302’ in program
  
 ^
prog.cpp:13:2: error: stray ‘\240’ in program
  
  ^
prog.cpp:15:1: error: stray ‘\302’ in program
  
 ^
prog.cpp:15:2: error: stray ‘\240’ in program
  
  ^
prog.cpp:19:1: error: stray ‘\302’ in program
  
 ^
prog.cpp:19:2: error: stray ‘\240’ in program
  
  ^
prog.cpp:47:1: error: stray ‘\302’ in program
  
 ^
prog.cpp:47:2: error: stray ‘\240’ in program
  
  ^
prog.cpp:79:1: error: stray ‘\302’ in program
  
 ^
prog.cpp:79:2: error: stray ‘\240’ in program
  
  ^
prog.cpp:83:1: error: stray ‘\302’ in program
  
 ^
prog.cpp:83:2: error: stray ‘\240’ in program
  
  ^
prog.cpp:85:1: error: stray ‘\302’ in program
  
 ^
prog.cpp:85:2: error: stray ‘\240’ in program
  
  ^
prog.cpp:165:1: error: stray ‘\302’ in program
  
 ^
prog.cpp:165:2: error: stray ‘\240’ in program
  
  ^
prog.cpp:185:1: error: stray ‘\302’ in program
  
 ^
prog.cpp:185:2: error: stray ‘\240’ in program
  
  ^
stdout
Standard output is empty