Submission #336548

# Submission time Handle Problem Language Result Execution time Memory
336548 2020-12-15T15:35:08 Z amunduzbaev Xoractive (IZhO19_xoractive) C++14
Compilation error
0 ms 0 KB
#include "interactive.h"
#include "grader.cpp"
#include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define ub upper_bound
#define lb lower_bound
#define ll long long 
#define ld long double 
#define pii pair<int, int>
#define pll pair<ll, ll>
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(),x.rend()
#define prc(n) fixed << setprecision(n)
#define fastios ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pi acos(-1);
const int inf = 1e9+7;
const int N = 105;
 
vector<int> guess(int n){
	int fir = ask(1);
	vector<set<int>>a(10);
	for(int i=0;i<7;i++){
		vector<int>tmp;
		vector<int>ans, ans1;
		for(int j=2;j<=n;j++){
			if((1 << i) & j) tmp.pb(j);
		}
		if(sz(tmp) == 0) continue;
		ans = get_pairwise_xor(tmp);
		tmp.pb(1);
		ans1 = get_pairwise_xor(tmp);
		set<int>ss;
		for(int i=0;i<sz(ans1);i++) ss.insert(ans1[i]);
		for(int i=0;i<sz(ans);i++) ss.erase(ans[i]);
		for(auto x = ss.begin(); x != ss.end(); x++){
			int xx = *x;
			xx ^= fir;
			a[i].insert(xx);
		}
	}
	vector<int>ans(n);
	ans[0] = fir;
	for(int i=1;i<n;i++){
		int j = 0, l = 0;
		while(sz(a[j]) == 0 && j <= 10) j++;
		if(j > 10) break;
		int cur = *a[j].begin();
		int in = 0;
		for(l = 0;l<7;l++){
			if(a[l].find(cur) != a[l].end()){
				a[l].erase(cur);
				in += (1<<l);
			}
		}
		ans[in -1] = cur;
	}
	 //for(int i=0;i<n;i++) cout<<ans[i]<<" ";
	//cout<<endl;
	return ans;
}

Compilation message

/tmp/cckVQpR6.o: In function `query()':
grader.cpp:(.text+0x30): multiple definition of `query()'
/tmp/cc5EWy7U.o:Xoractive.cpp:(.text+0x30): first defined here
/tmp/cckVQpR6.o: In function `ask(int)':
grader.cpp:(.text+0x60): multiple definition of `ask(int)'
/tmp/cc5EWy7U.o:Xoractive.cpp:(.text+0x60): first defined here
/tmp/cckVQpR6.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/cc5EWy7U.o:Xoractive.cpp:(.text.startup+0x0): first defined here
/tmp/cckVQpR6.o: In function `get_pairwise_xor(std::vector<int, std::allocator<int> >)':
grader.cpp:(.text+0xc0): multiple definition of `get_pairwise_xor(std::vector<int, std::allocator<int> >)'
/tmp/cc5EWy7U.o:Xoractive.cpp:(.text+0xc0): first defined here
collect2: error: ld returned 1 exit status