Submission #207753

# Submission time Handle Problem Language Result Execution time Memory
207753 2020-03-08T19:29:56 Z mahmoudbadawy Xoractive (IZhO19_xoractive) C++17
0 / 100
8 ms 380 KB
#include "interactive.h"
#include <bits/stdc++.h>
using namespace std;

map<int,int> pos;

vector<int> guess(int n) {
	vector<int> ans=vector<int>(n);
	ans[0]=ask(1);
	for(int i=0;i<=6;i++)
	{
		vector<int> v;
		for(int j=2;j<=n;j++)
		{
			if(j&(1<<i))
				v.push_back(j);
		}
		if(!v.size()) continue;
		vector<int> r1=get_pairwise_xor(v);
		v.push_back(1);
		vector<int> r2=get_pairwise_xor(v);
		map<int,int> mp;
		for(int x:r2)
			mp[x]++;
		for(int x:r1)
			mp[x]--;
		for(auto x:mp)
		{
			if(x.second==0) continue;
			pos[x.first^ans[0]]|=(1<<i);
		}
	}
	for(auto i:pos)
		ans[i.second-1]=i.first;
	return ans;
	/*vector <int> ans;
	for (int i = 1; i <= n; i++) {
		ans.push_back(ask(i));
	}
	return ans;*/
}
# Verdict Execution time Memory Grader output
1 Runtime error 5 ms 380 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 376 KB Output is not correct
2 Halted 0 ms 0 KB -