# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1192131 | TroySer | Crayfish scrivener (IOI12_scrivener) | C++20 | 0 ms | 0 KiB |
#include <ext/rope>
#include <bits/stdc++.h>
using namespace std;
using namespace __gnu_cxx;
const ll SZ = 1e7 + 1;
crope states[SZ];
int currentIndex = 0;
void Init() {}
void TypeLetter(char L) {
states[currentIndex + 1] = states[currentIndex] + L;
currentIndex++;
}
void UndoCommands(int U) {
states[currentIndex + 1] = states[currentIndex - U];
currentIndex++;
}
char GetLetter(int P) {
return states[currentIndex][P];
}