답안 #603282

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
603282 2022-07-23T21:23:34 Z Ozy Xoractive (IZhO19_xoractive) C++17
0 / 100
1 ms 336 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);
    map<lli,lli> apa;

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

    int cont = 0;
    for (auto aa : a) apa[aa]++;
    for (auto bb : b) apa[bb]--;

    for (auto m : apa) {
        if (m.second == 0) continue;
        lli x = m.first^prim;
        r.push_back(x);
    }

    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);

        debug(bit);
        for (auto act : k) {
            debugsl(act);
            mapa[act] |= pot;
        }
        cout << endl;
    }

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

    return res;
}

Compilation message

Xoractive.cpp: In function 'std::vector<int> aparecen(std::vector<int>)':
Xoractive.cpp:22:9: warning: unused variable 'cont' [-Wunused-variable]
   22 |     int cont = 0;
      |         ^~~~
# 결과 실행 시간 메모리 Grader output
1 Failed 1 ms 260 KB do not print anything to standard output
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 336 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -