Competition Set - Codeforces】的更多相关文章

Codeforces 1082C Multi-Subject Competition https://vjudge.net/problem/CodeForces-1082C 题目: A multi-subject competition is coming! The competition has mm different subjects participants can choose from. That's why Alex (the coach) should form a compet…
传送门:http://codeforces.com/contest/1082/problem/C C. Multi-Subject Competition time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A multi-subject competition is coming! The competition has mm …
C. Multi-Subject Competition 题目链接:https://codeforces.com/contest/1082/problem/C 题意: 给出n个信息,每个信息包含专业编号以及对应权值,先要求选出一些数量相等的专业(每种专业选的个数相等,不要求每种专业都要选),使对应权值最大. 题解: 一开始想的是枚举选的数量,然后再枚举每种专业从大到小贪心地选,但是时间超了... 其实还有更巧妙地方法,直接考虑每种专业选的个数从1到x对答案的贡献,用一个数组保存这一个贡献就好了.…
M. Quadcopter Competition time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output Polycarp takes part in a quadcopter competition. According to the rules a flying robot should: start the race from…
题目链接:Multi-Subject Competition 题意:给定n名选手,每名选手都有唯一选择的科目si和对应的能力水平.并且给定科目数量为m.求选定若干个科目,并且每个科目参与选手数量相同的情况下的最大能力水平. 题解:每位选手扔到对应的科目里面,从1-m遍历科目,能力值排序下,维护下能力值和,大于0就给到当前位置人数答案加上该值,否则跳出(给负价值是没有意义的),最后遍历一遍人数对应的价值,拿最大的即可. #include <vector> #include <cstdio&…
C. Multi-Subject Competition time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output A multi-subject competition is coming! The competition has m different subjects participants can choose from. That'…
https://codeforc.es/contest/1082/problem/C 题目大意:有m个类型,n个人,每个人有一个所属类型k和一个能力v,要求所选的类型的人个数相等并且使v总和最大(n,m<=1e5) 题解:用vector存下每种类型的各个v并且每种类型根据v按从大到小排序,然后处理出每种类型的前缀和,然后扫每种类型的所有前缀和,如果该类型在i处的前缀和大于0,则相应的ans[i]加上这个类型在i处的前缀和,最后求出max(ans[i])(1<=i<=n)即可. 注意:这题…
题意:你在一家公司工作\(t\)天,负责给饮水机灌水,饮水机最初有\(k\)升水,水的范围必须要在\([l,r]\)内,同事每天白天都会喝\(x\)升水,你在每天大清早可以给饮水机灌\(y\)升水,问你在公司工作的这几天内,饮水机会不会发生故障. 题解:假如\(x>=y\),那么,我们贪心的思路一定是每天让水减的尽可能少,所以每天都要加水,这里要注意第一天的情况,如果第一天加水后大于\(r\)话,那么第一天大清早是不能加水的,这里我们要特判一下,接下来用if判断就行了. 假如\(x < y\)…
[Educational Codeforces Round 16]E. Generate a String 试题描述 zscoder wants to generate an input file for some programming competition problem. His input is a string consisting of n letters 'a'. He is too lazy to write a generator so he will manually ge…
This is the first time I took part in Codeforces Competition.The only felt is that my IQ was contempted.The problem in Div2 was so...em,how to say,anyway I even daren't to believe.Yesterday I solved two fifths of problems.You see? I'm just a guy full…