Please subscribe to the official Codeforces channel in Telegram via the link https://t.me/codeforces_official. ×

 
 
 
 
General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
153067946 Out of competition:
* newbie_forever_at_cp
1665D - 37 C++17 (GCC 7-32) Accepted 343 ms 8 KB 2022-04-08 19:22:01 2022-04-08 19:57:42
→ Source
#include<bits/stdc++.h>
#define pb push_back
//#define mp make_pair
#define fastread ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define openfile ifstream cin; ofstream cout; cin.open("input.txt"); cout.open("output.txt");
#define f(i, x, y) for(ll i = x; i < y; i++)
#define all(X) X.begin(), X.end()
// #define int long long
#define ll long long
#define key pair<ll, ll>
#define keyy pair<pair<ll, ll>, ll>
#define keyyy pair<pair<ll, ll>, pair<ll, ll>>
// #define ordered_set<T> tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>
#define keyd pair<double, double>
#define ff first
#define ss second
// #define double long double
const ll mod = 1e9 + 7;
// const ll mod = 998244353;
// const ll mod = 360 * 12 * (double)1e10;
const ll inf = 1e18 + 5;
const ll infi = 2e9;
using namespace std;

int main()
{
    int T; cin>>T;
    while(T--)
    {
        int st = 1, sub = 0, ans = 0;
        f(i, 0, 30)
        {
            cout<<"? "<<st - ans<<" "<<3*st - ans<<"\n"; fflush(stdout);
            int x; cin>>x;
            if(x == 2*st) ans += st;
            st *= 2;
        }
        cout<<"! "<<ans<<"\n";
    }
}
?
Time: ? ms, memory: ? KB
Verdict: ?
Input
?
Participant's output
?
Jury's answer
?
Checker comment
?
Diagnostics
?
Click to see test details