Submission #231538

# Submission time Handle Problem Language Result Execution time Memory
231538 2020-05-13T23:09:17 Z blacktulip Crayfish scrivener (IOI12_scrivener) C++17
60 / 100
1000 ms 14836 KB
#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;
string ss;
int cev,koy,say,flag,last=-1;
vector< pair<int,int> > v;
void Init(){
	
}
void TypeLetter(char L){
	v.pb(mp(say++,L-'a'));
	ss+=L;
}
void UndoCommands(int U){
	v.pb(mp(U,-1));
	flag=1;
}
char GetLetter(int P){
	string s{};
	if(flag==1){
		last=(int)v.size();
		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());
		ss=s;
		flag=0;
		//~ flag=1;
	}
	//~ flag++;
	//~ cout<<s.size()<<endl;
	//~ if((int)s.size()<=P){return -1;}
	return ss[P];
}
# Verdict Execution time Memory Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 4 ms 256 KB Output is correct
3 Correct 5 ms 416 KB Output is correct
4 Correct 5 ms 256 KB Output is correct
5 Correct 5 ms 256 KB Output is correct
6 Correct 4 ms 256 KB Output is correct
7 Correct 4 ms 256 KB Output is correct
8 Correct 5 ms 256 KB Output is correct
9 Correct 4 ms 256 KB Output is correct
10 Correct 4 ms 256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 4 ms 384 KB Output is correct
4 Correct 4 ms 384 KB Output is correct
5 Correct 5 ms 256 KB Output is correct
6 Correct 4 ms 256 KB Output is correct
7 Correct 5 ms 384 KB Output is correct
8 Correct 5 ms 512 KB Output is correct
9 Correct 5 ms 384 KB Output is correct
10 Correct 4 ms 256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 384 KB Output is correct
2 Correct 11 ms 384 KB Output is correct
3 Correct 11 ms 512 KB Output is correct
4 Correct 10 ms 512 KB Output is correct
5 Correct 12 ms 560 KB Output is correct
6 Correct 9 ms 512 KB Output is correct
7 Correct 8 ms 512 KB Output is correct
8 Correct 13 ms 512 KB Output is correct
9 Correct 14 ms 512 KB Output is correct
10 Correct 7 ms 512 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 158 ms 11932 KB Output is correct
2 Correct 170 ms 12812 KB Output is correct
3 Correct 173 ms 13688 KB Output is correct
4 Correct 216 ms 14736 KB Output is correct
5 Correct 203 ms 13300 KB Output is correct
6 Correct 180 ms 13864 KB Output is correct
7 Correct 244 ms 14068 KB Output is correct
8 Correct 212 ms 14836 KB Output is correct
9 Correct 178 ms 13584 KB Output is correct
10 Correct 183 ms 13560 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1090 ms 1764 KB Time limit exceeded
2 Halted 0 ms 0 KB -