| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 119826 | dolphingarlic | Crayfish scrivener (IOI12_scrivener) | C++14 | 1080 ms | 253496 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>
using namespace std;
pair<char, char> v[1000001];
string s, t;
int indx = 0;
bool got = false;
void get() {
int ptr = indx - 1;
while (ptr != -1) {
while (ptr != -1 && v[ptr].first == 'U') ptr -= (int)v[ptr].second + 1;
s += v[ptr--].second;
}
for (int i = 0; i < s.size(); i++) t[i] = s[s.size() - 1 - i];
}
void Init() {
}
void TypeLetter(char L) {
v[indx++] = {'T', L};
}
void UndoCommands(int U) {
v[indx++] = {'U', (char)U};
}
char GetLetter(int P) {
if (!got) {
get();
got = true;
}
return t[P];
}
// int main() {
// int t;
// cin >> t;
// for (int i = 0; i < t; i++) {
// char c, d; int e;
// cin >> c;
// switch (c) {
// case 'T':
// cin >> d;
// TypeLetter(d);
// break;
// case 'P':
// cin >> e;
// cout << GetLetter(e) << '\n';
// break;
// default:
// cin >> e;
// UndoCommands(e);
// }
// }
// }
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... | ||||
