Codeforces Beta Round #95 (Div. 2)C. The World is a Theatre

来源:互联网 发布:lol淘宝刷点券会封号吗 编辑:程序博客网 时间:2024/05/16 11:38
#include <iostream>#include <cstdio>#include <cmath>#include <algorithm>using namespace std;long long n, m, t;long long C(long long x, long long y){    long long q = 1, sum = 1;    for(int i = x+1; i <= y; i++)    {        sum = sum*i/q;        q++;    }    return sum;}int main(){    cin >> n >> m >> t;    long long s = 0;    for(int i = 4; i <= n; i++)    {        if(i <= n && t-i<=m && t-i>0)        {            s = s + C(i, n)*C(t-i, m);        }    }    cout << s << endl;}

原创粉丝点击