제출 #1014720

#제출 시각아이디문제언어결과실행 시간메모리
1014720jcelinXoractive (IZhO19_xoractive)C++14
100 / 100
4 ms780 KiB
#include <bits/stdc++.h>
#include "interactive.h"
using namespace std;

typedef long long ll;

typedef pair<int,int> ii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<ll> vll;
typedef vector<pll> vpll;

#define PB push_back
#define PF push_front
#define PPB pop_back
#define PPF pop_front
#define X first
#define Y second
#define MP make_pair
#define all(x) (x).begin(), (x).end()

const int mod = 1e9 + 7; //998244353;
const int inf = 1e9 + 7;
const ll INF = 1e18 + 7;
const int logo = 20;
const int MAXN = 1e6 + 7;
const int off = 1 << logo;
const int trsz = off << 1;
const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, -1, 1};

/*
int ask(int x){
	return 0;
}

vi get_pairwise_xor(vi &x){
	return {0};
}
*/

vi guess(int n){
	vi ans(n);
	ans[0] = ask(1);
	map<int, int> mp, cnt;
	for(int bt=0; bt<7; bt++){
		cnt.clear();
		vi a, b;
		for(int i=2; i<=n; i++) if (i & (1 << bt)) a.PB(i);
		if(!a.empty()) b = get_pairwise_xor(a);
		a.PB(1);
		for(int &j : b) cnt[j]--;
		b = get_pairwise_xor(a);
		for(int &j : b) cnt[j]++;
		for(auto &x : cnt){
			if(!x.Y) continue;
			mp[x.X] += (1 << bt);
		}
	}
	for(auto &x : mp) ans[x.Y - 1] = x.X ^ ans[0];
	return ans;
}

/*
void solve(){
	
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int tt = 1;
	//cin >> tt;
	while(tt--) solve();
	return 0;
}
*/
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...