Submission #310610

#TimeUsernameProblemLanguageResultExecution timeMemory
310610tengiz05Crayfish scrivener (IOI12_scrivener)C++17
60 / 100
1099 ms10652 KiB
#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int>> op;
void Init() {
	return;
}
bool completed = false;
void TypeLetter(char L) {
	op.push_back({0, L});
	completed = false;
}

void UndoCommands(int U) {
	op.push_back({1, U});
	completed = false;
}
string s;
char GetLetter(int P) {
	if(completed == true){
		return s[P];
	}s.clear();
	for(int i=(int)op.size()-1; i>=0; i--){
		int typ = op[i].first;
		int l = op[i].second;
		if(typ == false){
			s.push_back(l);
		}else {
			i -= l;
		}
	}
	reverse(s.begin(), s.end());
	completed = true;
	return s[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...