Submission #131220

#TimeUsernameProblemLanguageResultExecution timeMemory
131220arthurconmyParrots (IOI11_parrots)C++14
Compilation error
0 ms0 KiB
/* Arthur Conmy / arthurconmy */
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <map>
#include <queue>
#include <bitset>
#include <random>
#include <stack>
#include <deque>
#include <chrono>
using namespace std;

#ifndef ARTHUR_LOCAL
	#include "decoder.h"
	//#include "decoderlib.h"
	#include "encoder.h"
	//#include "encoderlib.h"
#endif

// void send(int N)
// {
// 	cout << N << endl;
// }

void encode(int N, int M[])
{
	for(int i=0; i<N; i++)
	{
		for(int j=0; j<8; j++)
		{
			if(1<<j & M[i]) send((8*i) + j);
		}
	}
}

void decode(int N, int L, int X[])
{
	vector<int> ans(N);

	for(int ind=0; ind<L; ind++)
	{
		int i=int(X[ind]/8);
		int j=X[ind]%8;

		ans[i]+=1<<j;
	}

	for(auto u:ans) output(u);

 	// int i, b;
 	// for(i=0; i<L; i++)
 	// {
  	//   	b = X[i];
  	//   	output(b);
  	// }
}

// int X[3];
// int Y[12];

// int main()
// {
// 	X[0]=255;
// 	X[2]=170;

// 	Y[0]=23;
// 	Y[1]=21;
// 	Y[2]=17;
// 	Y[3]=19;
// 	Y[4]=7;
// 	Y[6]=6;
// 	Y[5]=5;
// 	Y[7]=4;
// 	Y[8]=3;
// 	Y[9]=2;
// 	Y[10]=1;
// 	Y[11]=0;

// 	encode(3,X);
// 	decode(3,12,Y);
// }

Compilation message (stderr)

encoder.cpp: In function 'void encode(int, int*)':
encoder.cpp:35:20: error: 'send' was not declared in this scope
    if(1<<j & M[i]) send((8*i) + j);
                    ^~~~
encoder.cpp:35:20: note: suggested alternative: 'srand'
    if(1<<j & M[i]) send((8*i) + j);
                    ^~~~
                    srand
encoder.cpp: In function 'void decode(int, int, int*)':
encoder.cpp:52:18: error: 'output' was not declared in this scope
  for(auto u:ans) output(u);
                  ^~~~~~
encoder.cpp:52:18: note: suggested alternative: 'getpt'
  for(auto u:ans) output(u);
                  ^~~~~~
                  getpt

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