# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
398129 | chirathnirodha | 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.
//Coded by Chirath Nirodha
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define P push
#define I insert
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
using namespace std;
const ll mod=1e9+7;
vector<string> s;
vector<ll> seq;
void Init(){
string x(0,' ');
seq.PB(0);
s.PB(x);
}
void TypeLetter(char L) {
string x=s[seq[seq.size()-1]];
x.PB(L);
seq.PB(s.size());
s.PB(x);
}
void UndoCommands(int U) {
seq.PB(seq[seq.size()-1-U]);
}
char GetLetter(int P) {
return s[seq[seq.size()-1]][P];
}