Submission #792580

# Submission time Handle Problem Language Result Execution time Memory
792580 2023-07-25T07:05:11 Z irmuun Saveit (IOI10_saveit) C++17
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
#include "grader.h"
#include "decoder.h"
 
using namespace std;
 
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define all(s) s.begin(),s.end()
 
void decode(int N,int H){
    int ver[N];
    for(int i=0;i<N;i++){
        ver[i]=0;
        for(int j=0;j<10;j++){
            ver[i]+=(1<<j)*decode_bit();
        }
    }
    for(int i=0;i<H;i++){
        int dist=0;
        for(int j=0;j<10;j++){
            dist+=(1<<j)*decode_bit();
        }
        hops(i,ver[0],dist);
        for(int j=1;j<N;j++){
            int x=decode_bit();
            x+=decode_bit();
            if(x==0){
                dist--;
            }
            if(x==2){
                dist++;
            }
            hops(i,ver[j],dist);
        }
    }
}
#include<bits/stdc++.h>
#include "grader.h"
#include "decoder.h"
 
using namespace std;
 
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define all(s) s.begin(),s.end()
 
void decode(int N,int H){
    int ver[N];
    for(int i=0;i<N;i++){
        ver[i]=0;
        for(int j=0;j<10;j++){
            ver[i]+=(1<<j)*decode_bit();
        }
    }
    for(int i=0;i<H;i++){
        int dist=0;
        for(int j=0;j<10;j++){
            dist+=(1<<j)*decode_bit();
        }
        hops(i,ver[0],dist);
        for(int j=1;j<N;j++){
            int x=decode_bit();
            x+=decode_bit();
            if(x==0){
                dist--;
            }
            if(x==2){
                dist++;
            }
            hops(i,ver[j],dist);
        }
    }
}

Compilation message

/usr/bin/ld: /tmp/cc94Uusb.o: in function `main':
grader_encoder.c:(.text.startup+0x122): undefined reference to `encode(int, int, int, int*, int*)'
/usr/bin/ld: /tmp/ccYT0Jtb.o: in function `decode(int, int)':
encoder.cpp:(.text+0xb1): undefined reference to `decode_bit()'
/usr/bin/ld: encoder.cpp:(.text+0x109): undefined reference to `decode_bit()'
/usr/bin/ld: encoder.cpp:(.text+0x126): undefined reference to `hops(int, int, int)'
/usr/bin/ld: encoder.cpp:(.text+0x153): undefined reference to `hops(int, int, int)'
/usr/bin/ld: encoder.cpp:(.text+0x15d): undefined reference to `decode_bit()'
/usr/bin/ld: encoder.cpp:(.text+0x164): undefined reference to `decode_bit()'
collect2: error: ld returned 1 exit status