摘要:
A - Buggy Sorting Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As 阅读全文
摘要:
A - Balloons There are quite a lot of ways to have fun with inflatable balloons. For example, you can fill them with water and see what happens. Grigo 阅读全文
摘要:
A - Wrestling Match Nowadays, at least one wrestling match is held every year in our country. There are a lot of people in the game is "good player”, 阅读全文
摘要:
A. Petr stands in line of n people, but he doesn't know exactly which position he occupies. He can say that there are no less than a people standing i 阅读全文
摘要:
Problem A : Electric Bill 题目大意:进行电量分级制收费,1000kwh及以下一档收费,1000kwh以上按另一档收费,给出每个人的电量总额,问每人应支付多少钱。 思路:基础if else题,对于每个电量判断是否大于1000,再分别计算≤1000的价格和>1000的价格,最后 阅读全文
摘要:
A Appeal to the Audience 要想使得总和最大,就要使最大值被计算的次数最多。要想某个数被计算的多,就要使得它经过尽量多的节点。于是我们的目标就是找到 k 条从长到短的链,这些链互不重合,且一端是叶子节点。可以通过长链剖分来将这棵树分为 k 条互不相交的长链,然后按照长度分配元素 阅读全文