#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;
}
# |
결과 |
실행 시간 |
메모리 |
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 |