Submission #524496

# Submission time Handle Problem Language Result Execution time Memory
524496 2022-02-09T10:07:05 Z Mr_Husanboy Xoractive (IZhO19_xoractive) C++14
6 / 100
4 ms 584 KB
#include "interactive.h"
#include<bits/stdc++.h>
using namespace std;

vector<int> guess(int n) {
	vector<int> ans;
	if(n<16){
		for(int i=1;i<=n;i++){
			ans.push_back(ask(i));
		}return ans;
	} int tem=ask(1);
	map<int,int> mp;
	for(int i=0;i<7;i++){
		vector<int> t;
		for(int j=1;j<n;j++){
			if(j>>i & 1) t.push_back(j+1);
		}
		vector<int> a=get_pairwise_xor(t);
		t.push_back(1);
		vector<int> b=get_pairwise_xor(t);
		map<int,int> m;
		for(auto u:a) m[u]--;
		for(auto u:b) m[u]++;
		for(auto u:m){
			if(u.second>0) mp[u.first^tem]+=(1<<i);
		}
	}vector<int> ans2(n);
	for(auto u:mp) if(u.second<n) ans[u.second]=u.first;
	return ans2;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 200 KB Output is correct
2 Correct 0 ms 200 KB Output is correct
3 Correct 0 ms 200 KB Output is correct
4 Correct 0 ms 200 KB Output is correct
# Verdict Execution time Memory Grader output
1 Runtime error 4 ms 584 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -