제출 #1363788

#제출 시각아이디문제언어결과실행 시간메모리
1363788solution6312Message (IOI24_message)C++17
컴파일 에러
0 ms0 KiB
#include "message.h"
#include <iostream>
#include <vector>
#include <algorithm>
#include <cassert>
using namespace std;

vector<bool> send_packet(vector<bool> A);
namespace encode
{
    int pos[16];
    void send_message(vector<bool> M, vector<bool> C)
    {
        reverse(M.begin(), M.end());
        M.push_back(1);
        while (M.size()<1025) M.push_back(0);
        reverse(M.begin(), M.end());
        M.push_back(0);
        assert(M.size()==1026);
        //for (bool i:M) cerr<<i; cerr<<endl;
        int cnt=0;
        for (int i=0; i<31; i++)
        {
            if (!C[i])
            {
                pos[cnt++]=i;
            }
        }
        assert(cnt==16);
        for (int i=0; i<5; i++)
        {
            vector<bool> packet(31, ((pos[0]>>i)&1));
            send_packet(packet);
        }
        for (int i=5; i<35; i++)
        {
            vector<bool> packet(31, 0);
            int lft=i*15-76;
            for (int j=1; j<16; j++) packet[pos[j]]=M[lft+j];
            if (i<pos[0]+5) packet[pos[0]]=C[i-5];
            else packet[pos[0]]=C[i-4];
            send_packet(packet);
        }
        for (int i=35; i<71; i++)
        {
            vector<bool> packet(31, 0);
            int lft=i*16-110;
            for (int j=0; j<16; j++) packet[pos[j]]=M[lft+j];
            send_packet(packet);
        }
    }
}
void send_message(vector<bool> M, vector<bool> C) { encode::send_message(M, C); }

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

/usr/bin/ld: /tmp/ccauaxsw.o: in function `(anonymous namespace)::run_decoder()':
stub.cpp:(.text+0x65c): undefined reference to `receive_message(std::vector<std::vector<bool, std::allocator<bool> >, std::allocator<std::vector<bool, std::allocator<bool> > > >)'
collect2: error: ld returned 1 exit status