Lang:G++
Edit12345678910111213141516171819202122232425262728293031#include <stdio.h>#include <string.h>#include <math.h>#define N 100#define M 100#define PI 3.1415926int active[N];int visit[N];int n, m, g, p, l;int tower[N][2];int city[M][2];double dis2(int x1, int y1, int x2, int y2) {double dx = x2 - x1;double dy = y2 - y1;return dx * dx + dy * dy;}double theta(int i, int j, int c) {double l1 = dis2(tower[i][0], tower[i][1], city[c][0], city[c][1]);double l2 = dis2(tower[j][0], tower[j][1], city[c][0], city[c][1]);double l3 = dis2(tower[i][0], tower[i][1], tower[j][0], tower[j][1]);double cost = (l1 + l2 - l3) / (2 * sqrt(l1 * l2));return acos(cost);}bool in(int i, int j, int k, int c) {double t1 = theta(i, j, c);double t2 = theta(i, k, c);