Submission #815707

#TimeUsernameProblemLanguageResultExecution timeMemory
815707annabeth9680Crayfish scrivener (IOI12_scrivener)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; const int MAXN = 1e6+25; int curop,sz; char arr[MAXN]; int ops[MAXN],par[MAXN][20],dep[MAXN]; void init(){ curop = 1; sz = 1; ops[curop] = 1; dep[sz] = 0; for(int i = 0;i<20;++i){ par[1][i] = 1; } } void TypeLetter(char L){ curop++; sz++; ops[curop] = sz; arr[sz] = L; dep[sz] = dep[ops[curop-1]]+1; par[sz][0] = ops[curop-1]; for(int i = 0;i<20;++i){ par[sz][i] = par[par[sz][i-1]][i-1]; } } void UndoCommands(int U){ curop++; ops[curop] = ops[curop-U-1]; } char GetLetter(int P){ P++; int cur = ops[curop]; int d = dep[cur]-P; for(int i = 0;i<20;++i){ if((d >> i)&1){ cur = par[cur][i]; } } return arr[cur]; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccj6Er05.o: in function `main':
grader.cpp:(.text.startup+0x63): undefined reference to `Init()'
collect2: error: ld returned 1 exit status