1207E - XOR Guessing - CodeForces Solution


bitmasks interactive math *1900

Please click on ads to support us..

C++ Code:

#include<cstdio>

#include<algorithm>

#include<queue>

#include<vector>

#include<string>

#include<cctype>

#include<set>

#include<map>

#include<cstring>

#include<iostream>

#include<cmath>

#include<stack>

#include<cstdlib> 

#include<bits/stdc++.h>

using namespace std;

#define rep(i,a,n) for(int i=a;i<n;i++)

#define scd(a) scanf("%d",&a)

#define scdd(a,b) scanf("%d %d",&a,&b)

#define sclld(a) scanf("%lld",&a)

#define sclldd(a,b) scanf("%lld %lld",&a,&b)

#define CLR(a) memset(a,0,sizeof(a))

#define CLR1(a) memset(a,-1,sizeof(a))

#define Debug1(a) cout<<a<<"************"<<endl

#define Debug2(a) cout<<a<<"############"<<endl

#define Debug(a,b) cout<<a<<" "<<b<<"**********"<<endl

typedef long long ll;

const int mod=998244353;

const int maxn=1000000+100;

const double pi=acos(-1);

typedef pair<int,int>P;

const ll inf=1ll<<60;

int q_m(int a,int b,int mod);

inline int lowbit(int x){return x&(-x);}

void solve(int a,int b,int c){

	cout<<"! "<<a*b+c<<endl;

}

void ss(int b){

	rep(i,1,101)cout<<i*b<<" ";

}

int main(){

    int mid=1<<7;

    cout<<"? ";

    ss(mid);

    cout<<endl;

    fflush(stdout);

    int a;

    scd(a);

    a=a%mid;

    cout<<"? ";

    rep(i,1,101)printf("%d ",i);

    cout<<endl;

    fflush(stdout);

    int b;scd(b);

    b=b/mid;

    solve(b,mid,a);

} 

int q_m(int a,int b,int mod){int ans=1;while(b){if(b&1)ans=ans*a%mod;a=a*a%mod;b>>=1;}return ans%mod;}


Comments

Submit
0 Comments
More Questions

1624C - Division by Two and Permutation
1288A - Deadline
1617A - Forbidden Subsequence
914A - Perfect Squares
873D - Merge Sort
1251A - Broken Keyboard
463B - Caisa and Pylons
584A - Olesya and Rodion
799A - Carrot Cakes
1569B - Chess Tournament
1047B - Cover Points
1381B - Unmerge
1256A - Payment Without Change
908B - New Year and Buggy Bot
979A - Pizza Pizza Pizza
731A - Night at the Museum
742A - Arpa’s hard exam and Mehrdad’s naive cheat
1492A - Three swimmers
1360E - Polygon
1517D - Explorer Space
1230B - Ania and Minimizing
1201A - Important Exam
676A - Nicholas and Permutation
431A - Black Square
474B - Worms
987B - High School Become Human
1223A - CME
1658B - Marin and Anti-coprime Permutation
14B - Young Photographer
143A - Help Vasilisa the Wise 2