题目链接:https://www.luogu.com.cn/problem/P2181
这一题,我们可以发现,交点只会由两条边组成,不会由三个及以上的边交于一点。
也就是说,所有的交点,都是由四个顶点唯一确定的。
那我们要做的就是从n个点中抽出4个点即可。
这是一个组合问题,可以用大C来求
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
unsigned long long n;
int main(){
cin >> n;
cout << n * (n - 1) / 2 * (n - 2) / 3 * (n - 3) / 4 << endl;
return 0;
}