# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
644953 | device | Crayfish scrivener (IOI12_scrivener) | C++17 | 0 ms | 0 KiB |
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>
#include <ext/rope>
using namespace std;
using namespace __gnu_cxx;
void Init();
void TypeLetter(char L);
void UndoCommands(int U);
char GetLetter(int P);
rope<char> str[1000005];
int cur;
void TypeLetter(char L) {
cur++;
str[cur] = str[cur-1];
str[cur] += L;
}
void UndoCommands(int U) {
cur++;
str[cur] = str[cur-U-1];
}
char GetLetter(int P) {
return str[cur][P];
}