Submission #1187915

#TimeUsernameProblemLanguageResultExecution timeMemory
1187915lance0Crayfish scrivener (IOI12_scrivener)C++20
0 / 100
176 ms184252 KiB
#include <ext/rope>
__gnu_cxx::crope ver[1000010]; //set up all versions with rope data struct
int curr_ver = 0; //and track version number
void Init(){
	
}
void TypeLetter(char L) {
	//newest version is just previous version + new char
	ver[curr_ver++] = ver[curr_ver-1] + L;
}

void UndoCommands(int U) {
	//using the fact undos are just jumps to U steps back, newest version = U steps back from last version
	ver[curr_ver++] = ver[curr_ver-1-U];
}

char GetLetter (int P) {
	//Pth letter is simply current version's Pth letter
	return ver[curr_ver][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...