이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int mxN = 1000005;
string ans;
vector<string> undo;
void Init() {
return;
}
void TypeLetter(char l) {
ans += l;
undo.push_back(ans);
}
void UndoCommands(int u) {
ans = undo[undo.size()-u-1];
undo.push_back(ans);
}
char GetLetter(int p){
return ans[p];
}
/*
int main() {
Init();
TypeLetter('a');
cout << ans << "\n";
TypeLetter('b');
cout << ans << "\n";
cout << GetLetter(1) << "\n";
TypeLetter('d');
cout << ans << "\n";
UndoCommands(2);
cout << ans << "\n";
UndoCommands(1);
cout << ans << "\n";
cout << GetLetter(2) << "\n";
TypeLetter('e');
cout << ans << "\n";
UndoCommands(1);
cout << ans << "\n";
UndoCommands(5);
cout << ans << "\n";
TypeLetter('c');
cout << ans << "\n";
cout << GetLetter(2) << "\n";
UndoCommands(2);
cout << ans << "\n";
cout << GetLetter(2) << "\n";
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... |