跳到正文

题解

题解:P7900 [COCI 2006/2007 #2] SJECIŠTA

sky2025约 1 分钟
原文
文章信息与版本

文章信息

发布
2025年6月27日
收录
2025年12月12日
更新
2026年11月14日
篇幅
约 1 分钟
题目
P7900

版本

  1. v1当前

思路:

在 nn 个点中选 4 个点可以组成 1 个交点,可得答案为 n×(n−1)÷2×(n−2)÷3×(n−3)÷4n\times(n-1)\div2\times(n-2)\div3\times(n-3)\div4 .

代码:

C++
#include<bits/stdc++.h>
using namespace std;
unsigned long long n,ans;
int main(){
	scanf("%lld",&n);
	ans=1ll*n*(n-1)/2*(n-2)/3*(n-3)/4;
	printf("%lld\n",ans);
	return 0;
}
原文