제출 #1221088

#제출 시각아이디문제언어결과실행 시간메모리
1221088siyanaXoractive (IZhO19_xoractive)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h>
#define int long long
#include "interactive.h"
using namespace std;
const int MAXN=110;
const int PAW=10;
vector<int>g[PAW];
vector<int>a[PAW];
map<int,int>m;
int arr[MAXN];
vector<int>find_multitude_numbers(vector<int>pos,int x){
    vector<int> ms_=get_pairwise_xor(pos);
    multiset<int> ms;
    for(int i=0;i<ms_.size();i++){
        ms.insert(ms_[i]);
    }
    while(ms.find(0)!=ms.end()) ms.erase(0);
    pos.push_back(1);
    vector<int>v_=get_pairwise_xor(pos);
    multiset<int>v;
    for(int i=0;i<v_.size();i++){
        v.insert(v_[i]);
    }
    while(ms.find(0)!=ms.end()) ms.erase(0);
    vector<int>nv;
    for(int el:v){
        if(ms.find(el)!=ms.end()){
            ms.erase(ms.find(el));
        }else{
            nv.push_back(el);
        }
    }
    nv.push_back(1);
    for(int i=0;i<nv.size();i++){
        nv[i]=nv[i]^x;
    }
    return nv;
}
vector<int> guess(int n){
    int x=ask(1);
    for(int paw=0;paw<=6;paw++){
        for(int i=2;i<=n;i++){
            if(i&(1<<paw)!=0){
                g[paw].push_back(i);
            }
        }
        a[paw]=find_multitude_numbers(g[paw],x);
    }
    for(int paw=0;paw<=6;paw++){
        for(int el:a[paw]){
            m[el]+=(1<<paw);
        }
    }
    for(auto it:m){
        if(it.first!=0){
            arr[it.second]=it.first;
        }
    }
    vector<int>result;
    for(int i=0;i<n;i++){
        result.push_back(arr[i]);
    }
    return result;
}

컴파일 시 표준 에러 (stderr) 메시지

/usr/bin/ld: /tmp/cc5nNNek.o: in function `find_multitude_numbers(std::vector<long long, std::allocator<long long> >, long long)':
Xoractive.cpp:(.text+0x4b4): undefined reference to `get_pairwise_xor(std::vector<long long, std::allocator<long long> >)'
/usr/bin/ld: Xoractive.cpp:(.text+0x65e): undefined reference to `get_pairwise_xor(std::vector<long long, std::allocator<long long> >)'
/usr/bin/ld: /tmp/cc5nNNek.o: in function `guess(long long)':
Xoractive.cpp:(.text+0xab1): undefined reference to `ask(long long)'
/usr/bin/ld: /tmp/cc045bEw.o: in function `main':
grader.cpp:(.text.startup+0xe4): undefined reference to `guess(int)'
collect2: error: ld returned 1 exit status