Submission #231310

#TimeUsernameProblemLanguageResultExecution timeMemory
231310blacktulipCrayfish scrivener (IOI12_scrivener)C++17
34 / 100
1095 ms8820 KiB
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define mp make_pair #define pb push_back char c; map<int,string> mpp; int cev,koy,say,flag; vector< pair<int,int> > v; void Init(){ } void TypeLetter(char L){ v.pb(mp(say++,L-'a')); } void UndoCommands(int U){ v.pb(mp(U,-1)); } char GetLetter(int P){ string s{}; if(flag==0){ reverse(v.begin(),v.end()); int ban=0; //~ cout<<v.size()<<endl; for(int i=0;i<(int)v.size();i++){ //~ cout<<ban<<"()"<<endl; if(ban>0){ban--;continue;} //~ cout<<i<<"**"<<endl; if(v[i].se==-1)ban=v[i].fi; else s+=v[i].se+'a'; } reverse(v.begin(),v.end()); //~ v.clear(); reverse(s.begin(),s.end()); //~ flag=1; } //~ flag++; //~ cout<<s.size()<<endl; //~ if((int)s.size()<=P){return -1;} 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...