Submission #356824

# Submission time Handle Problem Language Result Execution time Memory
356824 2021-01-23T18:50:41 Z Mefarnis Saveit (IOI10_saveit) C++14
Compilation error
0 ms 0 KB
// Encoder

#include <bits/stdc++.h>
#include "encoder.h"
#include "grader.h"
#define maxn 1000
#define pb push_back
using namespace std;

int dist[maxn];
vector<int> adj[maxn];

void encode(int n, int h, int m, int *v1, int *v2) {
	for( int i = 0 ; i < m ; i++ ) {
		int u = v1[i] , v = v2[i];
		adj[u].pb(v);
		adj[v].pb(u);
	}
	for( int src = 0 ; src < h ; src++ ) {
		queue<int> Q;
		memset(dist,-1,sizeof(dist));
		Q.push(src);
		dist[src] = 0;
		while(!Q.empty()) {
			int u = Q.front();
			Q.pop();
			int deg = adj[u].size();
			for( int i = 0 ; i < deg ; i++ ) {
				int v = adj[u][i];
				if(dist[v] == -1) {
					Q.push(v);
					dist[v] = dist[u]+1;
				}
			}
		}
		for( int i = 0 ; i < n ; i++ )
			for( int j = 0 ; j < 10 ; j++ )
				if(dist[i]&(1<<j))
					encode_bit(1);
				else
					encode_bit(0);
	}
}

// Decoder

#include <bits/stdc++.h>
#include "decoder.h"
#include "grader.h"
using namespace std;

void decode(int n, int h) {
	for( int i = 0 ; i < h ; i++ )
		for( int j = 0 ; j < n ; j++ ) {
			int val = 0;
			for( int k = 0 ; k < 10 ; k++ )
				val |= (1<<decode_bit());
			hops(i,j,val);
		}
}



    

Compilation message

/tmp/ccM6gI8M.o: In function `decode(int, int)':
encoder.cpp:(.text+0x81): undefined reference to `decode_bit()'
encoder.cpp:(.text+0xa1): undefined reference to `hops(int, int, int)'
collect2: error: ld returned 1 exit status

/tmp/ccvIenHw.o: In function `main':
grader_decoder.c:(.text.startup+0x126): undefined reference to `decode(int, int)'
collect2: error: ld returned 1 exit status