Submission #751730

#TimeUsernameProblemLanguageResultExecution timeMemory
751730allin27xCrayfish scrivener (IOI12_scrivener)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; const int n = (int)1e6+2; int sgt[2*n]={0}; int op = 0; char ch[n]; string res = ""; int undo[n]={0}; bool undid = 0; void update(int l, int r){ for (l+=n, r+=n+1; l<r; l>>=1, r>>=1){ if (l&1) sgt[l--] ^= 1; if (r&1) sgt[--r] ^= 1; } } int get(int a){ int res = 0; for (a+=n; a>=1; a>>=1) res ^= sgt[a]; return res; } void undoOper(){ for (int i=n-1; i>=0; --i){ if (!undo[i] || !get(i)) continue; update(i-undo[i], i-1); sgt[i] = 0; } for (int i=0; i<n; i++){ if (sgt[i]) res+=ch[i]; } } void init(){return;} void TypeLetter(char L){ ch[op] = L; sgt[n+op] = 1; op++; } void UndoCommands(int U){ sgt[n+op] = 1; undo[op] = U; op++; } char GetLetter(int P){ if (!undid) {undid = 1; undoOper();} return res[P]; }

Compilation message (stderr)

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