답안 #485177

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
485177 2021-11-06T12:47:38 Z MilosMilutinovic Xoractive (IZhO19_xoractive) C++14
0 / 100
3 ms 456 KB
#include "interactive.h"
#include <bits/stdc++.h>
#define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i))
#define fb(i,a,b) for(int (i) = (a); (i) >= (b); --(i))
#define ll long long
using namespace std;

map<int, int> mp;

vector<int> guess(int n){
	int x = ask(1);
	ff(i,0,6){
		vector<int> niz;
		ff(j,2,n){
			if(j&(1<<i))niz.push_back(j);
		}
		if(niz.empty())continue;
		auto q1 = get_pairwise_xor(niz);
		niz.push_back(1);
		auto q2 = get_pairwise_xor(niz);
		int sz = q1.size();
		int j = 0;
		ff(ind,0,q2.size()-1){
			if(q2[ind] == 0)continue;
			while(j < sz && q1[j] < q2[ind])j++;
			if(j < sz && q1[j] == q2[ind]){
				mp[x^q2[ind]] |= (1 << i);
			}
		}
	}
	vector<int> ans(n);
	ans[0] = x;
	for(auto x:mp)ans[x.second - 1] = x.first;
	return ans;
}

Compilation message

Xoractive.cpp: In function 'std::vector<int> guess(int)':
Xoractive.cpp:3:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
    3 | #define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i))
      |                           ^
Xoractive.cpp:12:2: note: in expansion of macro 'ff'
   12 |  ff(i,0,6){
      |  ^~
Xoractive.cpp:3:27: warning: unnecessary parentheses in declaration of 'j' [-Wparentheses]
    3 | #define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i))
      |                           ^
Xoractive.cpp:14:3: note: in expansion of macro 'ff'
   14 |   ff(j,2,n){
      |   ^~
Xoractive.cpp:3:27: warning: unnecessary parentheses in declaration of 'ind' [-Wparentheses]
    3 | #define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i))
      |                           ^
Xoractive.cpp:23:3: note: in expansion of macro 'ff'
   23 |   ff(ind,0,q2.size()-1){
      |   ^~
Xoractive.cpp:3:42: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    3 | #define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i))
      |                                      ~~~~^~~~~~
Xoractive.cpp:23:3: note: in expansion of macro 'ff'
   23 |   ff(ind,0,q2.size()-1){
      |   ^~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 200 KB Output is not correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 456 KB Output is not correct
2 Halted 0 ms 0 KB -