#include <bits/stdc++.h>
using namespace std;
vector< string > last;
struct node{
node *parent, *from;
char c;
};
node *root = NULL;
node *curr = NULL;
void Init(){
}
void TypeLetter(char c){
if(root == NULL){
root = new node{NULL,NULL,c};
curr = root;
return;
}
node *temp = new node{NULL,NULL,c};
temp->parent = curr;
temp->from = curr;
curr = temp;
}
void UndoCommands(int n){
node *first = curr;
for(int i = 0; i < n; i++){
curr = curr->from;
}
curr->from = first;
}
bool verif = false;
string s = "";
char GetLetter(int n){
if(!verif){
node* Node = curr;
while(Node){
s += Node->c;
Node = Node->parent;
}
verif = true;
reverse(s.begin(), s.end());
return s[n];
}else{
return s[n];
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
384 KB |
Output is correct |
2 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
256 KB |
Output is correct |
2 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1070 ms |
8856 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1058 ms |
8124 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |