先用dfs把大小为size的区域给求出来,用vector<vector >存储,剩下就是判断这些集合是否满足题目要求
#include<iostream>
#include<cstring>
#include<algorithm>
#include<math.h>
#include<map>
#include<vector>
#include<set>
#include<queue>
using namespace std;
struct node {
int index;
int x, y;
vector<int> con;
};
vector<node> v;
vector<vector<int> > ndCollect;
int ori, points;
map<string, int> dic;
int crossed(int x1, int y1, int x2, int y2) {
return x1 * y2 - y1 * x2;
}
void dfs(int n, vector<int> nodes, int cur) {
if (cur == points + 1) {
// for (int i = 0; i < nodes.size(); i++) {
// cout << nodes[i] << " ";
// }
// cout << endl;
if (n != ori) {
return;
} else {
nodes.pop_back();
vector<int> temp = nodes;
sort(temp.begin(), temp.end());
string str;
for (int i = 0; i < temp.size(); i++) {
str += '0' + temp[i];
}
if