이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
struct cmd { bool undo; int x; char c; };
string s;
vector<cmd> v;
bool rebuild = false;
void Init() {}
void TypeLetter(char L) {
rebuild = true;
v.push_back({false, 0, L});
}
void UndoCommands(int U) {
rebuild = true;
v.push_back({true, U, '.'});
}
char GetLetter(int P) {
if (rebuild)
{
rebuild = false;
s.clear();
for (int i = v.size() - 1; i >= 0; i--)
{
if (v[i].undo) i -= v[i].x;
else s.push_back(v[i].c);
}
reverse(s.begin(), s.end());
//cout << s << endl;
}
return s[P];
}
| # | 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... |