답안 #208351

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
208351 2020-03-10T21:52:40 Z MetB Xoractive (IZhO19_xoractive) C++14
0 / 100
7 ms 632 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 (int 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[x.second] = x.first;
	}

	return ans;
}

Compilation message

Xoractive.cpp: In function 'std::vector<int> guess(int)':
Xoractive.cpp:39:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i = 1; i < ans2.size (); i += 2) {
                   ~~^~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Runtime error 7 ms 632 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 5 ms 632 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -