# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
62511 | 2018-07-28T20:10:05 Z | zetapi | Crayfish scrivener (IOI12_scrivener) | C++14 | 969 ms | 263168 KB |
#include <bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair #define ll long long #define itr ::iterator typedef pair<int,int> pii; const int MAX=1e6; char last; char X[MAX]; int ind,size[MAX],par[MAX]; void Init() { } int get(int u) { if(X[u]>='a' and X[u]<='z') return u; return par[u]=get(par[u]); } void TypeLetter(char L) { ++ind; X[ind]=L; par[ind]=get(ind-1); size[ind]=size[par[ind]]+1; return ; } void UndoCommands(int U) { ++ind; par[ind]=get(ind-U-1); size[ind]=size[par[ind]]; return ; } char GetLetter(int P) { P++; int cur=ind; while(cur) { if(size[cur]==P and X[cur]>='a' and X[cur]<='z') return X[cur]; cur=get(par[cur]); } } /*signed main() { ios_base::sync_with_stdio(false); TypeLetter('a'); TypeLetter('b'); TypeLetter('d'); UndoCommands(2); UndoCommands(1); cout<<GetLetter(2); //cout<<ind<<" "<<par[ind]<<"\n"; return 0; }*/
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 920 ms | 263168 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 969 ms | 263168 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 906 ms | 263168 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 808 ms | 263168 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 900 ms | 263168 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |