This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
const int N = 1111111;
int p[N];
string q[N];
string s;
int cnt = 0;
void Init() { p[0] = -1; }
void TypeLetter(char L) {
int id = ++cnt;
p[id] = cnt - 1;
q[id] = q[cnt - 1] + L;
s.push_back(L);
}
void UndoCommands(int U) {
int par = cnt - U;
int id = ++cnt;
p[id] = par;
q[id] = q[par];
// for (int i = 0; i <= 20; i++) {
// cout << p[i] << " ";
// }
// cout << endl;
// for (int i = 0; i <= 20; i++) {
// cout << (char)v[i] << " ";
// }
// cout << endl;
}
char GetLetter(int P) { return q[cnt][P]; }
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |