제출 #440335

#제출 시각아이디문제언어결과실행 시간메모리
440335dutchXoractive (IZhO19_xoractive)C++17
6 / 100
10 ms456 KiB
#include <bits/stdc++.h>
#include "interactive.h"
using namespace std;

map<int, int> b;
set<int> s[8];
 
vector<int> guess(int n){
	vector<int> ans(n), a[8], x;
	ans[n-1] = ask(n);
	for(int i=1; i<n; ++i) a[0].push_back(i);
	for(int i=0; i<7; ++i)
		for(int j=0; j<n-1; ++j)
			if(!(j & (1<<i))) a[7-i].push_back(j+1);
	for(int i=1; i<8; ++i){
		x = get_pairwise_xor(a[i]);
		a[i].push_back(n);
		a[i] = get_pairwise_xor(a[i]);
		for(int j : x) a[i].erase(lower_bound(a[i].begin(), a[i].end(), j));
		for(int &j : a[i]) if(j^=ans[n-1]) b[j] |= 1<<(7-i);
	}
	for(int i=1; i<8; ++i) for(int j : a[i]) ans[127^b[j]] = j;
	return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...