4 0 0 0 1 1 0 1 1
1
格点上其实是不存在正三角形,正五边形,正六边形的,反正暴力上就好了
#include<map> #include<stack> #include<queue> #include<cmath> #include<cstdio> #include<vector> #include<string> #include<cstdlib> #include<cstring> #include<iostream> #include<algorithm> using namespace std; typedef long long LL; const int maxn = 200005; int T, n, m, x[maxn], y[maxn], a[maxn], ans, c[maxn]; bool check(int u) { int tot = 0; for (int i = 1; i < u;i++) for (int j = i + 1; j <= u; j++) c[tot++] = (x[a[i]] - x[a[j]])*(x[a[i]] - x[a[j]]) + (y[a[i]] - y[a[j]])*(y[a[i]] - y[a[j]]); sort(c, c + tot); if (u == 3 && c[0] == c[2]) return true; if (u == 4 && c[0] == c[3] && c[4] == c[5] && c[4] == c[0] + c[3]) return true; if (u == 6 && c[0] == c[5] && c[6] == c[11] && c[6] == 3 * c[0] && c[12] == c[14] && c[12] == 4 * c[0]) return true; return false; } void dfs(int x, int y, int z) { if (x > z) { if (check(z)) ans++; return; } for (int i = y; i <= n; i++) { a[x] = i; dfs(x + 1, i + 1, z); } } int main() { //scanf("%d", &T); while (scanf("%d", &n) != EOF) { ans = 0; for (int i = 1; i <= n; i++) { scanf("%d%d", &x[i], &y[i]); } for (int i = 3; i <= 6; i++) { if (i != 5) dfs(1, 1, i); } printf("%d\n", ans); } return 0; }