#include <bits/stdc++.h>
using namespace std;
char last;
string ans="";
vector<string> state(1000001);
int curr=0;
void Init() {
}
void TypeLetter(char L) {
last = L;
ans+=last;
state[curr++]=ans;
}
void UndoCommands(int U) {
//int i;
int k=curr;
ans=state[k-U-1];
state[curr++]=ans;
}
char GetLetter(int P) {
return ans[P];
}
/*
14
T a
T b
P 1
T d
U 2
U 1
P 2
T e
U 1
U 5
T c
P 2
U 2
P 2
*/
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
24 ms |
31616 KB |
Output is correct |
2 |
Correct |
23 ms |
31616 KB |
Output is correct |
3 |
Correct |
24 ms |
31616 KB |
Output is correct |
4 |
Correct |
24 ms |
31616 KB |
Output is correct |
5 |
Correct |
24 ms |
31616 KB |
Output is correct |
6 |
Correct |
23 ms |
31616 KB |
Output is correct |
7 |
Correct |
25 ms |
31616 KB |
Output is correct |
8 |
Correct |
23 ms |
31616 KB |
Output is correct |
9 |
Correct |
24 ms |
31616 KB |
Output is correct |
10 |
Correct |
24 ms |
31616 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
28 ms |
31616 KB |
Output is correct |
2 |
Correct |
24 ms |
31744 KB |
Output is correct |
3 |
Correct |
24 ms |
31616 KB |
Output is correct |
4 |
Correct |
23 ms |
31616 KB |
Output is correct |
5 |
Correct |
23 ms |
31616 KB |
Output is correct |
6 |
Correct |
23 ms |
31616 KB |
Output is correct |
7 |
Correct |
24 ms |
31616 KB |
Output is correct |
8 |
Correct |
24 ms |
31616 KB |
Output is correct |
9 |
Correct |
23 ms |
31616 KB |
Output is correct |
10 |
Correct |
23 ms |
31616 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
25 ms |
32256 KB |
Output is correct |
2 |
Correct |
26 ms |
32512 KB |
Output is correct |
3 |
Correct |
26 ms |
32384 KB |
Output is correct |
4 |
Correct |
24 ms |
32000 KB |
Output is correct |
5 |
Correct |
25 ms |
32512 KB |
Output is correct |
6 |
Correct |
26 ms |
33024 KB |
Output is correct |
7 |
Correct |
27 ms |
32128 KB |
Output is correct |
8 |
Correct |
26 ms |
34560 KB |
Output is correct |
9 |
Correct |
29 ms |
37632 KB |
Output is correct |
10 |
Correct |
25 ms |
33024 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
160 ms |
262148 KB |
Execution killed with signal 9 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
156 ms |
262148 KB |
Execution killed with signal 9 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |