답안 #485174

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
485174 2021-11-06T12:42:10 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,5){
		vector<int> niz;
		ff(j,1,n){
			if((j-1)&(1<<i))niz.push_back(j);
		}
		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){
			while(j < sz && q1[j] < q2[ind])j++;
			if(j < sz && q1[j] == q2[ind]){
				mp[q2[ind]] |= (1 << i);
			}
		}
	}
	vector<int> ans(n + 1);
	ans[1] = x;
	for(auto x:mp)ans[x.second] = 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,5){
      |  ^~
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,1,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:22:3: note: in expansion of macro 'ff'
   22 |   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:22:3: note: in expansion of macro 'ff'
   22 |   ff(ind,0,q2.size()-1){
      |   ^~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 200 KB Not correct size
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 456 KB Output is not correct
2 Halted 0 ms 0 KB -