#include <bits/stdc++.h>
#include "interactive.h"
/*
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target ("avx2")
*/
using namespace std;
/*
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template<class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
*/
#define F first
#define S second
#define pb push_back
#define FIO freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
#define md(a) ((a%mod+mod)%mod)
#define all(a) a.begin(), a.end()
#define MP make_pair
#define lc (id<<1)
#define rc (lc|1)
#define mid (l+r)/2
#define SZ(a) (ll)(a.size())
#define kill(a) cout << a << "\n", exit(0)
typedef pair<int,int> pii;
typedef pair<long long ,long long> pll;
typedef long long ll;
typedef long double ld;
typedef vector<vector<ll>> matrix;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll const maxn=5e6+10, mod=998244353, INF=1e18+10, LOG=21, sq=200;
/*
ll poww(ll a, ll b, ll mod) {
if (b == 0) return 1;
return 1 * poww(1 * a * a % mod, b / 2, mod) * ((b % 2 == 1) ? a : 1) % mod;
}*/
vector<int> guess(int n) {
vector <int> ans(n);
ans[0]=ask(1);
map<int, int> A;
for(int i=0;(1ll<<i)<=n;i++)
{
vector<int> vec;
for(ll j=2;j<=n;j++) if(j&(1ll<<i)) vec.pb(j);
vector<int> v1=get_pairwise_xor(vec);
vec.pb(1);
vector<int> v2=get_pairwise_xor(vec);
map<int, int> mp;
for(int t:v1) mp[t]--;
for(int t:v2) mp[t]++;
for(auto t:mp) if(t.S) A[t.F^ans[0]]|=(1ll<<i);
}
for(auto t:A) ans[t.S-1]=t.F;
return ans;
}
/*
int main(){
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}*/
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |