Submission #1232987

#TimeUsernameProblemLanguageResultExecution timeMemory
1232987clemmy14Crayfish scrivener (IOI12_scrivener)C++20
60 / 100
1095 ms7208 KiB
#include<bits/stdc++.h> using namespace std; int first=0; string ans, texts; vector<int> parent; void Init() { } void TypeLetter(char L) { texts.push_back(L); int par = parent.size()-1; if(par != -1 && texts[par] == ' ') par=parent[par]; parent.push_back(par); first=0; } void UndoCommands(int U) { texts.push_back(' '); int par = parent.size()-U-1; if(texts[par] == ' ') par=parent[par]; parent.push_back(par); first=0; } char GetLetter(int P) { if(first == 0) { ans.clear(); int id=texts.size()-1; while(id != -1) { ans.push_back(texts[id]); id=parent[id]; } reverse(ans.begin(), ans.end()); first++; } // for(auto x : parent) cout << x << ' '; // cout << endl; return ans[P]; }
#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...