不要把球传给我

codevs 1262 http://codevs.cn/problem/1262/
这里写图片描述

这是一个组合数问题,因为只能是升序,那题目就是在问你:C(3,j-1)是几。

#include<iostream>
#include<cstring>
#include<cstdio>
using namespace std;
long long ans=1,j,p=1;
int main()
{
    scanf("%lld",&j);
    ans=1ll*ans*(j-1)*(j-2)*(j-3)/(1*2*3);
    printf("%lld",ans);
    return 0;
}
原文地址:https://www.cnblogs.com/dfsac/p/7587877.html