1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <algorithm> 5 #include <vector> 6 #include <cmath> 7 #include <map> 8 using namespace std; 9 const int maxn = 1010;//点的个数 可以修改 maxn <= 20005即可满足要求 10 const double pi = 3.141592653589; 11 struct Point { 12 int id; 13 int x; 14 int y; 15 }; 16 bool cmp(Point p1, Point p2) { 17 if(p1.id != p2.id) return p1.id < p2.id; 18 } 19 20 class Loop { 21 public: 22 int n; 23 int G[maxn][maxn]; 24 vector<int> V[maxn]; 25 Point init[maxn], point[maxn], ans[maxn]; 26 map<string, int> mp; 27 28 void Init(int n) { 29 this -> n = n; 30 for(int i = 1; i <= n; i++) { 31 V[i].clear(); 32 } 33 mp.clear(); 34 memset(G, 0, sizeof(G)); 35 } 36 37 void input() { 38 for(int i = 1; i <= n; i++) { 39 scanf("%d %d %d",&init[i].id, &init[i].x, &init[i].y); 40 } 41 int u, v; 42 for(int i = 1; i <= n; i++) { 43 scanf("%d",&u); 44 for(int j = 1; j <= 4; j++) { 45 scanf("%d",&v); 46 if(v != 0) { 47 G[u][v] = G[v][u] = 1; 48 V[u].push_back(v); 49 } 50 } 51 } 52 } 53 54 void check(Point a[maxn], int cnt) { 55 if(cnt < 3) return ; 56 Point b[maxn]; 57 for(int i = 0; i < cnt; i++) { 58 b[i] = a[i]; 59 } 60 sort(b, b + cnt, cmp); 61 string s; 62 for(int i = 0; i < cnt; i++) { 63 char str[10]; 64 sprintf(str, "%d", b[i].id); 65 s += str; 66 } 67 s += '