wens Codeforces Round #645 (Div. 2)

本文讲述了作者在Codeforces Round #645 (Div. 2)中的经历,主要讨论了一道关于组织老年妇女聚会的问题。题目要求Maria在确保每位老人都能见到足够数量的其他老人的前提下,最大化聚会人数。解题关键在于排序和满足最大需求。
摘要由CSDN通过智能技术生成

这场cf,我败在了老奶奶身上。

就做出来一道题。还上分了。

A题,台灯。

十分钟就过了吧,470分。但是prime passed(预测试通过)。当时觉得完了,又是一场0题之路。

可是上分了。搞搞笑笑。

#include <iostream>

using namespace std;

int main() {
    int t, n, m;
    cin >> t;
    while (t--) {
        cin >> n >> m;
        cout << (n * m + 1) / 2 << '\n';
    }
}

B 老奶奶们,败在了不会用vector,string。清空数组,排序。都是自己手写的,耗费了大量的时间。

B. Maria Breaks the Self-isolation

time limit per test

2 seconds

memory limit per test

256 megabytes

input

standard input

output

standard output

Maria is the most active old lady in her house. She was tired of sitting at home. She decided to organize a ceremony against the coronavirus.

She has nn friends who are also grannies (Maria is not included in this number). The ii-th granny is ready to attend the ceremony, provided that at the time of her appearance in the courtyard there will be at least aiai other grannies there. Note that grannies can come into the courtyard at the same time. Formally, the granny ii agrees to come if the number of other grannies who came earlier or at the same time with her is greater than or equal to aiai.

Grannies gather in the courtyard like that.

  • Initially, only Maria is in the courtyard (that is, the initial number of grannies in the co
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值