Submission #935669

#TimeUsernameProblemLanguageResultExecution timeMemory
935669tnunCrayfish scrivener (IOI12_scrivener)C++14
0 / 100
1 ms604 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;
      |       ^~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...