CodeForces 546B C(Contest #1)】的更多相关文章

Description Colonel has n badges. He wants to give one badge to every of his n soldiers. Each badge has a coolness factor, which shows how much it's owner reached. Coolness factor can be increased by one for the cost of one coin. For every pair of so…
写这道题题解的目的就是纪念一下半个小时才读懂题...英文一多读一读就溜号... 读题时还时要静下心来... 题目链接: http://codeforces.com/contest/659/problem/B 题意: 给定地区及来自相应地区的人的分数,每个地区选两个分数最高的人 参加区域赛,如果选出的两个人唯一,则输出名字,否则如果还需要进行下一次比赛,输出"?". 分析: 不唯一的情况就是第二个人和第三个人的分数相同嘛...排个序找一下就好了. 代码: #include <bit…
time limit per test3 seconds memory limit per test256 megabytes inputstandard input outputstandard output Colonel has n badges. He wants to give one badge to every of his n soldiers. Each badge has a coolness factor, which shows how much it's owner r…
题目链接:https://codeforces.com/contest/1257/problem/E 题意:给三个序列k1,k2,k3,每个序列有一堆数,k1是前缀,k3是后缀,k2是中间,现可以从任意序列中选择一个数加入到另外的序列中,问最小操作次数还原成1-n的原序列(序列内部操作是任意的,不计入操作次数) 题解:k1,k2,k3分别排一下序,然后k1,k2,k3拼成一个序列,求这个序列的最长上升子序列的长度,然后n - lis就是答案. 举个例子k1 : 1 2 6 k2:   3 4 8…
题目链接:http://codeforces.com/problemset/problem/659/B 题意: n个人,m个区.给出n个人的姓名(保证不相同),属于的区域,所得分数.从每个区域中选出成绩最好的两个人去参加比赛,输出这两个人的名字.如果第三个人的成绩和第二个人的成绩相同,则输出“?”,保证结果不确定. 解题思路: 刚开始想用个什么STL容器把这三个属性存进去,然后根据区域的不同对每个区域的选手的分数进行排序,最后看选手确定,输出答案. 可是做比赛的时候没有想到应该用什么STL容器.…
time limit per test3 seconds memory limit per test256 megabytes inputstandard input outputstandard output One tradition of ACM-ICPC contests is that a team gets a balloon for every solved problem. We assume that the submission time doesn't matter and…
题意: 给你一个数n,代表n段区间,接下来有n个数(a1,a2,...an)代表每段区间的长度,第一段区间为[1,a1],第二段区间为[a1+1,a1+a2],...第i段区间为[ai-1+1,ai-1+ai] 接着输入一个整数m,之后有m个数,问你这m个数,每个数所在的区间编号. 分析: 可以采用计数排序,建立一个数组,将第i段区间[ai-1+1,ai-1+ai]赋值为i,这样输入一个数很快就可以输出它所在的区间编号; 因为区间中的值是有序的,所以还可以采用二分查找法. 代码如下: //方法一…
Description Colonel has n badges. He wants to give one badge to every of his n soldiers. Each badge has a coolness factor, which shows how much it's owner reached. Coolness factor can be increased by one for the cost of one coin. For every pair of so…
Description Colonel has n badges. He wants to give one badge to every of his n soldiers. Each badge has a coolness factor, which shows how much it's owner reached. Coolness factor can be increased by one for the cost of one coin. For every pair of so…
都是神题,我一题都不会,全程听学长题解打代码,我代码巨丑就不贴了 题解见巨神博客 假装自己没有做过这套…