답안 #387213

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
387213 2021-04-08T06:43:42 Z Kalashnikov Xoractive (IZhO19_xoractive) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#include "interactive.h"
 
using namespace std;

vector<int> guess(int n) {
	vector<int> a(n);
	a[0] = ask(1);
	map<int,int> ans;
	for(int i = 0; (1 << i) <= n; i ++) {
		vector<int> p;
		for(int j = 2; j <= n; j ++) {
			if(j & (1 << i)) {
				p.push_back(j);
			}
		}
		auto g1 = get_pairwise_xor(p);
		p.push_back(1);
		auto g2 = get_pairwise_xor(p);
		map<int,int> mp;
		for(auto to: g2) mp[to] ++;
		for(auto to: g1) mp[to] --;
		for(auto to: mp) {
			if(to.S) {
				ans[to.F^a[0]] |= (1 << i);
			}
		}
	}
	for(auto to: ans) {
		a[to.S-1] = to.F;
	}
	return a;
}

Compilation message

Xoractive.cpp: In function 'std::vector<int> guess(int)':
Xoractive.cpp:24:10: error: 'struct std::pair<const int, int>' has no member named 'S'
   24 |    if(to.S) {
      |          ^
Xoractive.cpp:25:12: error: 'struct std::pair<const int, int>' has no member named 'F'
   25 |     ans[to.F^a[0]] |= (1 << i);
      |            ^
Xoractive.cpp:30:8: error: 'struct std::pair<const int, int>' has no member named 'S'
   30 |   a[to.S-1] = to.F;
      |        ^
Xoractive.cpp:30:18: error: 'struct std::pair<const int, int>' has no member named 'F'
   30 |   a[to.S-1] = to.F;
      |                  ^