Submission #555788

# Submission time Handle Problem Language Result Execution time Memory
555788 2022-05-01T14:31:57 Z ngpin04 Xoractive (IZhO19_xoractive) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
#include "interactive.h"
#include "grader.cpp"
using namespace std;

map <int, int> pos;

void solve(int i, vector <int> p, int r, int n) {
	map <int, int> cnt;
	vector <int> tmp = get_pairwise_xor(p);
	for (int x : tmp)
		cnt[x]--;

	p.push_back(n);
	tmp = get_pairwise_xor(p);
	for (int x : tmp) {
		cnt[x]++;
		if (cnt[x] > 0)
			pos[x ^ r] |= (1 << i);
	}
}

vector<int> guess(int n) {
	int r = ask(n);
	for (int j = 0; j < 7; j++) {
		vector <int> p;
		for (int i = 1; i < n; i++)
			if (i & (1 << j))
				p.push_back(i);

		if (!p.size())
			continue;
		solve(j, p, r, n);
	}	

	vector <int> ans(n, 0);

	for (pair <int, int> pir : pos) 
		if (pir.fi != r)
			ans[pir.se - 1] = pir.fi;
	ans[n - 1] = r;	
	return ans;
}

Compilation message

/usr/bin/ld: /tmp/ccV8DJ34.o: in function `query()':
grader.cpp:(.text+0x440): multiple definition of `query()'; /tmp/ccU001v5.o:Xoractive.cpp:(.text+0x610): first defined here
/usr/bin/ld: /tmp/ccV8DJ34.o: in function `ask(int)':
grader.cpp:(.text+0x470): multiple definition of `ask(int)'; /tmp/ccU001v5.o:Xoractive.cpp:(.text+0x640): first defined here
/usr/bin/ld: /tmp/ccV8DJ34.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccU001v5.o:Xoractive.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccV8DJ34.o: in function `get_pairwise_xor(std::vector<int, std::allocator<int> >)':
grader.cpp:(.text+0x4d0): multiple definition of `get_pairwise_xor(std::vector<int, std::allocator<int> >)'; /tmp/ccU001v5.o:Xoractive.cpp:(.text+0x6a0): first defined here
collect2: error: ld returned 1 exit status