답안 #448659

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
448659 2021-07-31T12:07:11 Z vanic 질문 (CEOI14_question_grader) C++14
0 / 100
256 ms 99112 KB
#include <set>
#include <vector>

using namespace std;

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

void rek(int x, int br){
	if(x==13){
		return;
	}
	if(br==6){
		v.push_back(s);
		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(x==13){
		return;
	}
	if(br==6){
		v.push_back(s);
		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;
}


# 결과 실행 시간 메모리 Grader output
1 Runtime error 2 ms 584 KB Execution killed with signal 11
2 Incorrect 256 ms 99112 KB the encoded value must be greater than or equal to 1