Submission #260216

#TimeUsernameProblemLanguageResultExecution timeMemory
260216youssefbou62Crayfish scrivener (IOI12_scrivener)C++14
34 / 100
51 ms51612 KiB
#include <bits/stdc++.h> #define push_back pb using namespace std ; const int MAXN = 5005 ; int state , cnt , par[MAXN]; string ans[MAXN] ; void Init() { } void TypeLetter(char L) { ans[cnt] = ans[state]+L; par[cnt] = state ; state = cnt ; cnt ++ ; // cerr << "current answer: " << ans[state] << endl; } void UndoCommands(int U) { int u = state ; for(int k = 0 ; k < U ; k++ ){ u = par[u] ; } par[cnt] = state ; state = cnt ; ans[state] = ans[u] ; cnt ++ ; // cerr << "current answer "<< ans[state]<<endl; } char GetLetter(int P) { return ans[state][P]; } // int main() { // Init(); // int cmd_num; // bool tmp = scanf("%d", &cmd_num); // assert(tmp == 1); // int i; // for (i = 0; i < cmd_num; i++) { // char cmd; // tmp = scanf(" %c", &cmd); // assert(tmp == 1); // if (cmd == 'T') { // char letter; // tmp = scanf(" %c", &letter); // assert(tmp == 1); // TypeLetter(letter); // } // else if (cmd == 'U') { // int number; // tmp = scanf("%d", &number); // assert(tmp == 1); // UndoCommands(number); // } // else if (cmd == 'P') { // int index; // char letter; // tmp = scanf("%d", &index); // assert(tmp == 1); // letter = GetLetter(index); // printf("%c\n", letter); // } // } // puts("Let's test for cheating!!"); // return 0; // }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...