이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
// 人外有人,天外有天
// author: Ausp3x
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
typedef long long lng;
typedef unsigned int uint;
typedef unsigned long long ulng;
using namespace std;
using namespace __gnu_pbds;
int const INF32 = 0x3f3f3f3f;
lng const INF64 = 0x3f3f3f3f3f3f3f3f;
vector<string> history(1);
void Init() {
return;
}
void TypeLetter(char l) {
string res = history.back();
res += l;
history.push_back(res);
return;
}
void UndoCommands(int u) {
history.push_back(history[history.size() - u - 1]);
return;
}
char GetLetter(int p) {
return history.back()[p];
}
/*
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
Init();
TypeLetter('a');
TypeLetter('b');
cout << GetLetter(1) << endl;
TypeLetter('d');
UndoCommands(2);
UndoCommands(1);
cout << GetLetter(2) << endl;
TypeLetter('e');
UndoCommands(1);
UndoCommands(5);
TypeLetter('c');
cout << GetLetter(2) << endl;
UndoCommands(2);
cout << GetLetter(2) << endl;
return 0;
}
//*/
# | 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... |