#include<bits/stdc++.h>
#define pb push_back
using namespace std;
const int maxn = 2e6 + 10;
char last;
int n;
string onv[maxn];
vector < int > g;
int curr;
void Init()
{
n = 1;
onv[1] = "";
curr = 1;
g.pb(1);
}
void TypeLetter(char L) {
last = L;
n ++;
string pre = onv[curr];
onv[n] = pre + L;
curr = n;
g.pb(curr);
}
void UndoCommands(int U)
{
int sz = g.size()-1;
curr = g[sz - U];
g.pb(curr);
}
char GetLetter(int P) {
int state = curr;
return onv[state][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... |