Submission #310484

#TimeUsernameProblemLanguageResultExecution timeMemory
310484juggernautCrayfish scrivener (IOI12_scrivener)C++14
60 / 100
1095 ms8872 KiB
#include<bits/stdc++.h> //#include"grader.cpp" #define fr first #define sc second using namespace std; bool need_compile; char res[1000005]; int sz; vector<pair<bool,int>>op; void compile(){ need_compile=0; sz=0; for(int i=op.size()-1;i>=0;i--){ auto to=op[i]; if(to.fr)i-=to.sc; else res[sz++]=to.sc; } reverse(res,res+sz); } void Init(){} void TypeLetter(char val){ if(!need_compile)res[sz++]=val; op.push_back({0,int(val)}); } void UndoCommands(int num){ need_compile=1; op.push_back({1,num}); } char GetLetter(int pos){ if(need_compile)compile(); return res[pos]; }
#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...