【UKE!】2024.4.19

2024.4.19 【你知道的都是真相。只可惜那些并不是真相的全部。】

Friday 三月十一 谷雨


<BGM = “谷雨–音阙诗听”>

AC :Answer Coarse,粗劣的答案

CE :Compile Easily,轻松通过

PC :Perfect Compile 完美的编译

WA :Wonderful Answer,好答案

RE :Run Excellently,完美运行

TLE:Time Limit Enough,时间充裕

MLE:Memory Limit Enough,内存充裕

OLE:Output Limit Enough,输出合法

UKE:Unbelievably Keep Enough Score,难以置信地保持足够的分数


哇塞,今天第一次,第一次在洛谷上交出来UKE欸(乐
在这里插入图片描述

P2638 安全系统

//2024.4.19
//by white_ice
#include<bits/stdc++.h>
using namespace std;
#define itn unsigned long long
#define int unsigned long long
const int oo = 60;

itn st[oo][oo];

int n,a,b;

signed main(){
    //freopen("in.txt","r",stdin);
    //freopen("out.out","w",stdout);

    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    cin >> n >> a >> b;

    if (a==0&&b==0){
        cout << 1;
        return 0;
    }

    itn out = 1;
    for (itn i=1;i<=n;i++){
        out *= a+n-i+1;
        out /= i;
    }
    itn eut = 1;
    for (itn i=1;i<=n;i++){
        eut *= b+n-i+1;
        eut /= i;
    }

    cout << out*eut;

    return 0;
}

纯组合题,组合数学学的好直接切

把0和1分开考虑,对于一个01依次分辨,最后乘法原理就好。

  • 5
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值