Submission #935666

#TimeUsernameProblemLanguageResultExecution timeMemory
935666tnunCrayfish scrivener (IOI12_scrivener)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; #define pb push_back struct node{ char c; int p[20]; int h; }; vector<node> trie; const int N=1000003; int cur[N]; int current=0; int curs; node Add(char L,int par){ node j; j.h=trie[par].h+1; j.p[0]=par; j.c=L; for(int i=1;i<20;i++){ j.p[i]=trie[j.p[i-1]].p[i-1]; } return j; } void TypeLetter(char L){ cur[current]=trie.size(); trie.pb(Add(L,curs)); curs=cur[current]; current++; } void UndoCommands(int S){ cur[current]=cur[current-S+1]; curs=cur[current]; current++; } char GetLetter(int idx){ idx++; int v=curs; for(int i=19;i>=0;i--){ if(trie[trie[v].p[i]].h >= idx){ v=trie[v].p[i]; } } return trie[v].c; } void init(){ node first; first.c=0; for(int i=0;i<20;i++){ first.p[i]=0; } first.h=0; }

Compilation message (stderr)

scrivener.cpp: In function 'void init()':
scrivener.cpp:46:7: warning: variable 'first' set but not used [-Wunused-but-set-variable]
   46 |  node first;
      |       ^~~~~
/usr/bin/ld: /tmp/cc1hc8ip.o: in function `main':
grader.cpp:(.text.startup+0x63): undefined reference to `Init()'
collect2: error: ld returned 1 exit status