Submission #841516

# Submission time Handle Problem Language Result Execution time Memory
841516 2023-09-01T16:11:06 Z Elvin_Fritl Xoractive (IZhO19_xoractive) C++17
6 / 100
4 ms 464 KB
#include <bits/stdc++.h>
using namespace std;

    #include "interactive.h"


vector<int> guess(int n)
{

	int eded = ask(1);
	map<int,int>mm;
	for(int mask=6;mask>=0;mask--)
    {
        vector<int>v;
        for(int i=2;i<=n;i++)
        {
            if(i&(1<<mask)){
                v.push_back(i);
            }
        }
        if(v.size() == 0)
        {
            continue;
        }
        vector<int> fi = get_pairwise_xor(v);
        v.push_back(1);
        vector<int> se = get_pairwise_xor(v);
        map<int,int> m;
        for(int i:fi)
        {
            m[i]--;
        }
        for(int i:se)
        {
            m[i]++;
        }
        vector<int>res;
        for(int i=0;i<se.size();i++){
            if(m[se[i]] > 0){
                mm[(se[i]^eded)] |= (1<<mask);
            }
        }
	}
	vector<int>res(n);
	res[0] = eded;
	for(auto [x,i]:mm){
        res[i-1] = x;
	}
	return res;

}

Compilation message

Xoractive.cpp: In function 'std::vector<int> guess(int)':
Xoractive.cpp:38:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   38 |         for(int i=0;i<se.size();i++){
      |                     ~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 208 KB Output is correct
2 Correct 0 ms 208 KB Output is correct
3 Correct 1 ms 208 KB Output is correct
4 Correct 0 ms 208 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 336 KB Output is correct
2 Correct 3 ms 336 KB Output is correct
3 Correct 2 ms 336 KB Output is correct
4 Correct 3 ms 336 KB Output is correct
5 Correct 3 ms 336 KB Output is correct
6 Correct 4 ms 336 KB Output is correct
7 Correct 2 ms 336 KB Output is correct
8 Correct 3 ms 376 KB Output is correct
9 Correct 3 ms 336 KB Output is correct
10 Correct 3 ms 336 KB Output is correct
11 Correct 3 ms 336 KB Output is correct
12 Correct 4 ms 376 KB Output is correct
13 Correct 3 ms 336 KB Output is correct
14 Correct 3 ms 336 KB Output is correct
15 Correct 2 ms 336 KB Output is correct
16 Correct 4 ms 336 KB Output is correct
17 Correct 3 ms 336 KB Output is correct
18 Correct 3 ms 384 KB Output is correct
19 Correct 2 ms 332 KB Output is correct
20 Correct 3 ms 340 KB Output is correct
21 Correct 3 ms 336 KB Output is correct
22 Correct 4 ms 336 KB Output is correct
23 Correct 2 ms 336 KB Output is correct
24 Correct 4 ms 336 KB Output is correct
25 Correct 3 ms 336 KB Output is correct
26 Correct 3 ms 336 KB Output is correct
27 Correct 2 ms 336 KB Output is correct
28 Correct 3 ms 336 KB Output is correct
29 Correct 3 ms 284 KB Output is correct
30 Correct 3 ms 296 KB Output is correct
31 Runtime error 3 ms 464 KB Execution killed with signal 11
32 Halted 0 ms 0 KB -