Submission #603279

# Submission time Handle Problem Language Result Execution time Memory
603279 2022-07-23T21:07:57 Z Ozy Xoractive (IZhO19_xoractive) C++17
0 / 100
3 ms 720 KB
#include "interactive.h"
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define rep(i,a,b) for (int i = (a); i <= (b); i++)
#define repa(i,a,b) for (int i = (a); i >= (b); i--)
#define debug(a) cout << #a << " = " << a << endl
#define debugsl(a) cout << #a << " = " << a << ", "

int prim,cont,x,bit,pot;
map<int,int> mapa;
vector<int> res;

vector<int> aparecen(vector<int> b) {
    vector<int> r,a = b;
    a.push_back(1);

    a = get_pairwise_xor(a);
    b = get_pairwise_xor(b);

    cont = 0;
    for (auto act : b) {
        while (a[cont] < act) {
            x = a[cont]^prim;
            r.push_back(x);
            cont += 2;
        }
        cont++;
    }
    return r;
}

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

    prim = ask(1);
    res.resize(n);
    res[0] = prim;

    repa(bit,6,0) {
        k.clear();
        pot = 1<<bit;
        rep(i,0,n-1) if (i&pot) k.push_back(i+1);

        if (k.empty()) continue;
        k = aparecen(k);

        for (auto act : k) mapa[act] |= pot;
    }

    for (auto m : mapa) res[m.second] = m.first;

    return res;
}
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 720 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 464 KB Output is not correct
2 Halted 0 ms 0 KB -