Submission #1220532

#TimeUsernameProblemLanguageResultExecution timeMemory
1220532settopCrayfish scrivener (IOI12_scrivener)C++20
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #define int long long #define eb emplace_back #define S second #define dbg(v) cerr << #v << " = " << v << "\n" #define F first #define fall(i,a,n) for(int i=a;i<=n;i++) #define rfall(i,a,n) for(int i=a;i>=n;i--) #define pb push_back #define all(x) x.begin(),x.end() #define lsb(x) (x & -x) #define sz(x) (int)x.size() const int MAXN=1e6+10; const int MAXL=21; const int inf=1e14; const int MOD=998244353; using namespace std; typedef pair<int,int> pii; typedef tuple<int,int,int> trio; int cont=0,s=0,op[MAXN],last=0; int sparse[MAXN][MAXL]; set<pair<int,char>> st[MAXN]; void Init(){ } void TypeLetter(char L) { cont++; st[s].insert({cont,L}); sparse[cont][0]=last; fall(i,1,MAXL-1) sparse[cont][i]=sparse[sparse[cont][i-1]][i-1]; op[cont]=s; s++; } void UndoCommands(int U) { cont++; sparse[cont][0]=cont-U-1; fall(i,1,MAXL-1) sparse[cont][i]=sparse[sparse[cont][i-1]][i-1]; s=op[sparse[cont][0]]+1; op[cont]=s; last=cont; } char GetLetter(int P) { int x=cont; int p=0; while(true){ auto it=(--st[P].upper_bound({x,'z'})); auto [j,ans]=*it; if(sparse[x][p]==0 || op[sparse[x][p]]<=P) return ans; x=sparse[x][p]; p++; } }

Compilation message (stderr)

/usr/bin/ld: /tmp/cczpZGJz.o: in function `main':
grader.cpp:(.text.startup+0x16d): undefined reference to `UndoCommands(int)'
/usr/bin/ld: grader.cpp:(.text.startup+0x199): undefined reference to `GetLetter(int)'
collect2: error: ld returned 1 exit status