Submission #448660

# Submission time Handle Problem Language Result Execution time Memory
448660 2021-07-31T12:08:30 Z vanic Question (Grader is different from the original contest) (CEOI14_question_grader) C++14
0 / 100
462 ms 262148 KB
#include <set>
#include <vector>

using namespace std;

set < int > s;
vector < set < int > > v;

void rek(int x, int br){
	if(br==6){
		v.push_back(s);
		return;
	}
	if(x==13){
		return;
	}
	s.insert(x);
	rek(x+1, br+1);
	s.erase(x);
	rek(x+1, br);
}


void precompute(){
	rek(1, 0);
}

int encode (int n, int x, int y) {
	precompute();
	set < int > s1, s2;
	s1=v[x];
	s2=v[y];
	while(!s2.empty()){
		s1.erase(*s2.begin());
		s2.erase(s2.begin());
	}
	return *s1.begin();
}
#include <set>
#include <vector>

using namespace std;

set < int > s;
vector < set < int > > v;

void rek(int x, int br){
	if(br==6){
		v.push_back(s);
		return;
	}
	if(x==13){
		return;
	}
	s.insert(x);
	rek(x+1, br+1);
	s.erase(x);
	rek(x+1, br);
}


void precompute(){
	rek(1, 0);
}

int decode (int n, int q, int h) {
	precompute();
	set < int > s1=v[q];
	if(s1.find(h)!=s1.end()){
		return 1;
	}
	return 0;
}


# Verdict Execution time Memory Grader output
1 Runtime error 462 ms 262148 KB Execution killed with signal 9
2 Runtime error 462 ms 262148 KB Execution killed with signal 9