Submission #899144

# Submission time Handle Problem Language Result Execution time Memory
899144 2024-01-05T14:09:05 Z d4xn Xoractive (IZhO19_xoractive) C++17
0 / 100
3 ms 344 KB
#include "interactive.h"
#include "bits/stdc++.h"
using namespace std;

vector<int> guess(int n) {
	vector<int> ans(n);
	ans[0] = ask(1);

	map<int, int> mp;
	for (int bt = 0; bt < 7; bt++) {
		vector<int> a;
		for (int i = 2; i <= n; i++) {
			if ((i >> bt) & 1) a.push_back(i);
		}
		
		vector<int> b;
		if (!a.empty()) b = get_pairwise_xor(a);

		a.push_back(1);
		vector<int> c = get_pairwise_xor(a);
	
		map<int, int> cnt;
		for (int& j : b) {
			cnt[j]--;
		}
		for (int& j : c) {
			cnt[j]++;
		}

		for (auto& [x, y] : cnt) {
			if (!y) continue;
			mp[x] += (1 << bt);
		}
	}

	for (auto& [x, y] : mp) {
		ans[y-1] = x;
	}
	return ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output is not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 344 KB Output is not correct
2 Halted 0 ms 0 KB -