/*
vector <char> A[1e6+5];
vector <int> idx[1e6+5];
idx = -1;
stack <pair <char, int> > Ins;
*/
#include <bits/stdc++.h>
using namespace std;
struct Instruction {
char type;
int prev, x;
Instruction() {};
Instruction(char cc, int a1, int a2) {
type = cc;
prev = a1;
x = a2;
}
};
vector <Instruction> Ins;
vector <char> A;
int idx = -1;
void Init() {
//for (int i=0; i<1e6+5; i++) idx[i] = -1;
for (int i=0; i<1e6+5; i++) A.push_back(-1);
}
void TypeLetter(char L) {
idx++;
//int anterior = A[idx];
A[idx] = L;
//Ins.push_back(Instruction('T', anterior, L);
}
void ReverseType(Instruction it) {
A[idx] = it.prev;
}
void ReverseUndone(int u) {
idx += u;
}
void UndoCommands(int u) {
idx -= u;
}
char GetLetter(int p) {
return A[p];
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
1520 KB |
Output is correct |
2 |
Correct |
20 ms |
1524 KB |
Output is correct |
3 |
Correct |
9 ms |
1524 KB |
Output is correct |
4 |
Correct |
12 ms |
1528 KB |
Output is correct |
5 |
Correct |
9 ms |
1524 KB |
Output is correct |
6 |
Correct |
7 ms |
1524 KB |
Output is correct |
7 |
Correct |
8 ms |
1524 KB |
Output is correct |
8 |
Correct |
9 ms |
1524 KB |
Output is correct |
9 |
Correct |
9 ms |
1524 KB |
Output is correct |
10 |
Correct |
9 ms |
1524 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
1528 KB |
Output is correct |
2 |
Correct |
12 ms |
1524 KB |
Output is correct |
3 |
Correct |
9 ms |
1520 KB |
Output is correct |
4 |
Correct |
9 ms |
1524 KB |
Output is correct |
5 |
Correct |
9 ms |
1524 KB |
Output is correct |
6 |
Correct |
9 ms |
1524 KB |
Output is correct |
7 |
Correct |
9 ms |
1520 KB |
Output is correct |
8 |
Correct |
9 ms |
1524 KB |
Output is correct |
9 |
Correct |
9 ms |
1520 KB |
Output is correct |
10 |
Correct |
9 ms |
1524 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
11 ms |
2928 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
16 ms |
2928 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
15 ms |
2796 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |