제출 #1133946

#제출 시각아이디문제언어결과실행 시간메모리
1133946AgageldiXoractive (IZhO19_xoractive)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
#include "interactive.h"
using namespace std;

#define ll long long
#define N 200005
#define pb push_back
#define ff first
#define ss second
#define sz(s) (int)s.size()

int val;
vector <int> a, b, h;
vector <pair<int,int> > answer;
map <int,int> vis, vip;

vector <int> guess(int n) {
	val = ask(n);
	answer.pb(make_pair(val, n));
	for(int i = 0; i <= 7; i++) {
		b.clear();
		h.clear();
		vip.clear();
		for(int j = 1; j < n; j++) {
			if((j&(1 << i))) b.pb(j);
		}
		if(!sz(b)) continue;
		vector <int> a1 = get_pairwise_xor(b);
		b.pb(n);
		vector <int> a2 = get_pairwise_xor(b);
		for(auto j : a1) {
			vip[j]++;
		}
		for(auto j : a2) {
			vip[j]--;
		}
		for(auto j : vip) {
			if(j.ff && j.ss)
			vis[j.ff  ^ val] |= (1 << i);
		}
	}
	for(auto i:vis) {
		a[i.ss - 1] = i.ff;
	}
	a[n - 1] = y;
	return a;
}

컴파일 시 표준 에러 (stderr) 메시지

Xoractive.cpp: In function 'std::vector<int> guess(int)':
Xoractive.cpp:45:20: error: 'y' was not declared in this scope
   45 |         a[n - 1] = y;
      |                    ^