Submission #1000422

#TimeUsernameProblemLanguageResultExecution timeMemory
1000422jer033Crayfish scrivener (IOI12_scrivener)C++17
0 / 100
271 ms99892 KiB
#include <bits/stdc++.h> using namespace std; vector<vector<int>> stac; void Init() { vector<int> initial(23, 0); stac.push_back(initial); } void TypeLetter(char L) { int x = stac.size(); vector<int> newstac; newstac.push_back(stac[x-1][0]+1); newstac.push_back(L-'a'); newstac.push_back(x-1); for (int i=3; i<=22; i++) newstac.push_back(stac[x-1][i-1]); stac.push_back(newstac); } void UndoCommands(int U) { int curr = stac.size() - 1; stac.push_back(stac[curr-U]); } char GetLetter(int P) { int height = stac.size(); int text_length = stac[height-1][0]; int akyat = text_length-1-P; int curr = height-1; for (int i=20; i>=0; i--) { if (akyat>=(1<<i)) { akyat -= (1<<i); curr = stac[curr][i+2]; } } char ans = ('a'+stac[curr][1]); return ans; }
#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...