# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1009090 | Rifal | Crayfish scrivener (IOI12_scrivener) | C++14 | 60 ms | 13504 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>
#define fi first
#define se second
using namespace std;
vector<pair<int,char>> v;
string cur;
void Init() {}
void TypeLetter(char L) {
v.push_back({-1,L});
}
void UndoCommands(int U) {
v.push_back({U,' '});
}
char GetLetter(int P) {
if(v.size() <= 5e3) {
for(int i = 0; i < v.size(); i++) {
if(v[i].fi == -1) {
cur.push_back(v[i].se);
}
else {
cur.clear();
int cnt = 0;
for(int j = i; j >= 0; j--)
{
if (cnt > 0)
{
cnt--;
continue;
}
if (v[i].first == -1)
{
cur.push_back(v[i].second);
}
else
{
cnt = v[i].first;
}
}
reverse(cur.begin(), cur.end());
}
}
}
else {
}
return cur[P];
}
Compilation message (stderr)
# | 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... |