답안 #208349

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
208349 2020-03-10T21:51:13 Z MetB Xoractive (IZhO19_xoractive) C++14
컴파일 오류
0 ms 0 KB
#include "interactive.h"
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;

#define N 2000001

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

const ll INF = 1e18, MOD = 1e9 + 7, MOD2 = 1e6 + 3;

map <int, int> ind;
int n;

vector <int> guess () {
	cin >> n;

	int d = ask (1);

	for (int b = 0; b < 7; b++) {
		vector <int> v;

		for (int i = 2; i <= n; i++) {
			if (i & (1 << b)) v.push_back (i);
		}

		vector <int> ans = get_pairwise_xor (v);
		v.push_back (1);
		vector <int> ans2 = get_pairwise_xor (v);

		for (int a : ans)
			ans2.erase (find (ans.begin (), ans.end (), a));

		sort (ans2.begin(), ans2.end());

		for (int i = 1; i < ans2.size (); i += 2) {
			ind[ans2[i] ^ d] |= (1 << d);
		}
	}

	vector <int> ans (n);

	ans[0] = d;

	for (auto x : ind) {
		ans[ind.second] = ind.first;
	}

	return ans;
}

Compilation message

Xoractive.cpp: In function 'std::vector<int> guess()':
Xoractive.cpp:40:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i = 1; i < ans2.size (); i += 2) {
                   ~~^~~~~~~~~~~~~~
Xoractive.cpp:50:11: error: 'class std::map<int, int>' has no member named 'second'; did you mean 'end'?
   ans[ind.second] = ind.first;
           ^~~~~~
           end
Xoractive.cpp:50:25: error: 'class std::map<int, int>' has no member named 'first'
   ans[ind.second] = ind.first;
                         ^~~~~