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 maxq=1e6;
pair<int,char> pre[maxq+1];
int curr;
string s;
void Init() {
}
void TypeLetter(char l) {
curr++;
pre[curr]={curr-1,l};
}
void UndoCommands(int u) {
curr++;
pre[curr]={curr-u,'.'};
}
char GetLetter(int p) {
if(curr){
while(curr){
if(pre[curr].second!='.')s+=pre[curr].second;
curr=pre[curr].first;
}
reverse(s.begin(),s.end());
}
return s[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... |