https://codeforces.com/contest/1433/problem/E
题目大意:
n个人(n是偶数)跳了两轮舞,每轮舞正好有n/2个人。你的任务是找出n个人跳两轮舞的方法,如果每轮舞正好由n/2个人组成。每个人都应该属于这两种圆舞中的一种。
人相同位置不同也算是同一种方案。
input
2
output
1
input
4
output
3
input
8
output
1260
input
20
output
12164510040883200
1300的题目,vp是一脸懵逼:这题这么好做吗?
好吧,vp结束后发现是排列组合。(文科生不懂系列
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<LL,LL> PII;
const LL MAXN=1e18,MINN=-MAXN,INF=0x3f3f3f3f;
const LL N=1e6+10,M=2023;
const LL mod=100000007;
const double PI=3.1415926535;
#define endl '\n'
LL a[N];
int main()
{
cin.tie(0); cout.tie(0); ios::sync_with_stdio(false);
LL T=1;
//cin>>T;
while(T--)
{
LL n;
cin>>n;
LL sum=1;
for(LL i=1;i<=n;i++)
{
sum=sum*i;
}
sum*=2;
sum/=(n*n);
cout<<sum<<endl;
}
return 0;
}
- 数论 Round Codeforces Dances 677数论round codeforces dances codeforces version dances round 数论codeforces product round 数论codeforces思维 数学 数论codeforces shovels buying 数论educational codeforces chains 数论educational codeforces equalize 数论codeforces absolute beauty 数论codeforces admirer milena educational codeforces round rated