Submission #202391

# Submission time Handle Problem Language Result Execution time Memory
202391 2020-02-16T02:56:31 Z klungs Xoractive (IZhO19_xoractive) C++14
Compilation error
0 ms 0 KB
#include "interactive.h"
#include <bits/stdc++.h>
using namespace std;

vector <int> ans;

vector<int> contains(vector<int> q) {
	vector<int> qf = q;
	qf.push_back(1);
	auto res1 = get_pairwise_xor(qf);
	auto res2 = get_pairwise_xor(f);
	set<int> gg (res1.begin(), res1.end());
	for (auto x : res2) gg.erase(res2);
	return vector<int>(gg.begin(), gg.end());
}

vector<int> guess(int n) {
	ans.resize(n + 1);
	ans[1] = ask(1);
	
	vector<int> questions[7], answers[7];
	
	for (int i = 2; i <= n; i++) {
		for (int j = 0; j < 7; j++) if ((1 << j) & i) {
			questions[j].push_back(i);
		}
	}
	
	map<int, int> id;
	for (int j = 0; j < 7; j++) {
		answers[j] = contains(questions[j]);
		for (int x : answers[j]) {
			id[x] ^= (1 << j);
		}
	}
	
	for (auto x : id) {
		ans[x.second] = x.first;
	}
	
	// for (int i = 1; i <= n; i++) {
	// 	int num = ask(i);
	// 	cnt[num]++;
	// 	ans.push_back(num);
	// 	// assert(cnt[num] <= 1);
	// }
	return ans;
}

Compilation message

Xoractive.cpp: In function 'std::vector<int> contains(std::vector<int>)':
Xoractive.cpp:11:31: error: 'f' was not declared in this scope
  auto res2 = get_pairwise_xor(f);
                               ^
Xoractive.cpp:11:31: note: suggested alternative: 'qf'
  auto res2 = get_pairwise_xor(f);
                               ^
                               qf
Xoractive.cpp:13:16: error: unable to deduce 'auto&&' from 'res2'
  for (auto x : res2) gg.erase(res2);
                ^~~~