Submission #231316

# Submission time Handle Problem Language Result Execution time Memory
231316 2020-05-13T11:08:10 Z blacktulip Crayfish scrivener (IOI12_scrivener) C++17
0 / 100
135 ms 12756 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;
int cev,koy,say,flag,last=-1;
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(last!=(int)v.size()){
		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());
		//~ flag=1;
	}
	//~ flag++;
	//~ cout<<s.size()<<endl;
	//~ if((int)s.size()<=P){return -1;}
	return s[P];
}
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 4 ms 256 KB Output is correct
2 Incorrect 4 ms 384 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 135 ms 12756 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 14 ms 1404 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -