AtCoder Beginner Contest 185

导读:
简单的题目,只说明题意,或者直接说明结论
下面的难题,会做详细的解释和证明
立个flag,在座的大佬们做个见证:一个月刷60场ABC,现在2021/7/3,第十八天,已打卡十五场。

A - ABC Preparation

输出最小值

void work()
{
  int a, b, c, d; cin >> a >> b >> c >> d;
  cout << min(min(a, b), min(c, d));
}

B - Smartphone Addiction

void work()
{
  int n, m, t; cin >> n >> m >> t;
  int now = n, last = 0;
  while (m -- )
  {
    int a, b; cin >> a >> b;
    now -= a - last;
    if (now <= 0)
    {
      cout << "No" << endl;
      return;
    }
    // printf("now = %d, a - last = %d\n", now, a - last);
    now += b - a;
    if (now > n) now = n;
    // printf("now = %d, a - last = %d, b - a = %d\n", now, a - last, b - a);
    last = b;
    if (!m)
    {
      now -= t - b;
      // printf("now = %d, t - b = %d\n", now, t - b);
      if (now <= 0)
      {
         cout << "No" << endl;
         return;
      }
    }
  }
  cout << "Yes" << endl;
  return;
}

C - Duodecim Ferra

n长度,有n-1个数,选11个空插入板子,隔板法

void work()
{
  long long n; cin >> n;
  long long ans = 1;
  for (long long i = 1; i <= 11; i ++ ) 
    ans = ans * (n - i) / i;
  cout << ans << endl;
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值