Submission #68018

#TimeUsernameProblemLanguageResultExecution timeMemory
68018naderjemelParachute rings (IOI12_rings)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
const int LOG = 21;
struct node
{
	char c; int s;
	node *anc[LOG];
	node(){
		for(int i=0;i<LOG;i++) anc[i] = NULL;
		s=0;
	}
}*tree [1000005];

int id;
void Init(){
	id=1;
	tree[0] = new node();

}
void TypeLetter(char L) {
	int n=id++;
	tree[n] = new node();
	tree[n]->s = tree[n-1]->s+1;
	tree[n]->c = L;
	tree[n]->anc[0]=tree[n-1];
	for(int i=1;i<LOG;i++) tree[n]->anc[i] = (tree[n]->anc[i-1]) ? (tree[n]->anc[i-1])->anc[i-1] : NULL; 
}

void UndoCommands(int U) {
	int ret=id-1-U;
	int n=id++;
	tree[n]=tree[ret];
}


char GetLetter(int P) {
	int n=id-1;
	node *h = new node();
	h=tree[n];
	int up=tree[n]->s - 1 - P;
	for(int i=LOG-1;i>=0;i--){
		if(up - (1<<i) >= 0){
			up-=(1<<i);
			h=h->anc[i];
		}
	}
	return h->c;
}

Compilation message (stderr)

/tmp/cc2zNiwV.o: In function `main':
grader.cpp:(.text.startup+0x80): undefined reference to `Init(int)'
grader.cpp:(.text.startup+0xb2): undefined reference to `Link(int, int)'
grader.cpp:(.text.startup+0xd5): undefined reference to `CountCritical()'
collect2: error: ld returned 1 exit status