# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
759615 | aykhn | Crayfish scrivener (IOI12_scrivener) | C++14 | 89 ms | 8752 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>
// author: aykhn
using namespace std;
#define mpr make_pair
#define pb push_back
#define fi first
#define se second
int x;
string s;
vector<pair<int, char>> calls;
void Init()
{
s = "";
}
void TypeLetter(char L)
{
calls.pb(mpr(1, L));
}
void UndoCommands(int U)
{
calls.pb(mpr(2, U));
}
char GetLetter(int P)
{
x++;
if (x == 1)
{
int i = calls.size() - 1;
while (i >= 0)
{
if (calls[i].fi == 2)
{
calls[i].fi = 0;
for (int k = 1; k <= calls[i].se; k++)
{
i--;
if (i >= 0) calls[i].fi = 0;
}
}
i--;
}
for (int i = 0; i < calls.size(); i++)
{
if (calls[i].fi == 1)
{
s.pb(calls[i].se);
}
}
}
return s[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... |