CodeForces 614D Skills】的更多相关文章

排序+枚举+二分 最大的那些变成A,小的那部分提高最小值 #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> using namespace std; +; int n; long long A,cf,cm,m; struct X { long long a; long long ans; int id; } s[maxn]; long long sum[maxn];…
D - Skills Lesha plays the recently published new version of the legendary game hacknet. In this version character skill mechanism was introduced. Now, each player character has exactly n skills. Each skill is represented by a non-negative integer ai…
链接 大意: $n$门课, 第$i$门分数$a_i$, 可以增加共$m$分, 求$cnt_{mx}*cf+mi*cm$的最大值 $cnt_{mx}$为满分的科目数, $mi$为最低分, $cf$, $cm$为给定系数 暴力枚举达到满分的科目数, 再二分答案求出最低分的最大值, 复杂度是$O(nlognlogmx)$ 似乎可以双指针省去二分答案的log, 不过懒得写了.. #include <iostream> #include <algorithm> #include <cs…
题意(CodeForces 614D) 每个人有\(n(n\le 10^5)\)个技能,技能等级都在\([0,10^9]\)的范围,每个技能有一个当前等级,所有技能的最高等级都为A.一个人的力量被记做以下两项的和: 1. 顶级技能的个数 *cf 2. 最低等级的技能 *cm 每个单位的钱能够提升一级力量.我们希望花尽可能少的钱,使得力量尽可能高. 分析 我二分的功力还是不足,要多努力.这题其实是一个非常明显的暴力:我们枚举提高到A的等级的个数(到不能提升为止),枚举这种情况下,我们能够令把多少人…
C. Developing Skills Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/581/problem/C Description Petya loves computer games. Finally a game that he's been waiting for so long came out! The main character of this game has n dif…
B. Skills 题目连接: http://www.codeforces.com/contest/613/problem/B Description Lesha plays the recently published new version of the legendary game hacknet. In this version character skill mechanism was introduced. Now, each player character has exactly…
题目链接:http://codeforces.com/problemset/problem/581/C 题目意思:给出 n 个数:a1, a2, ..., an (0 ≤ ai ≤ 100).给出值 k,可以把它加到任意的 ai 中,成为ai',对每个ai 加多少随你定,但是不能超过 100,k也不一定需要用完.现在需要求得最终的和⌊a1'⌋+⌊a2'⌋ + ... + ⌊an'⌋,使其最大. 比赛的时候真的很中规中矩地做,有那么一点思路:将 k 中的某些unit 加入到每个数中(而且优先需要处…
题目链接: B. Skills time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Lesha plays the recently published new version of the legendary game hacknet. In this version character skill mechanism was…
题 题意 给你n个数,可以花费1使得数字+1,最大加到A,最多花费m.最后,n个数里的最小值为min,为A的有k个,给你cm和cf,求force=min*cm+k*cf 的最大值,和n个数操作后的结果. 分析 我们如果要让最小值增加,那它加到和第二小的一样时,就有两个最小值,接下来就要两个一起增加..到后来就要好多个一起增加了. 那么我们可以枚举加到A的有多少个,然后用二分的方法求剩下m元,可以使最小值最大为多少. 怎么二分呢? l=0,r=A.mid=(l+r)/2. 我们假设现在是最小值为m…
大意: $n$门课, 第$i$门分数$a_i$, 可以增加共$m$分, 求$cnt_{mx}*cf+mi*cm$的最大值 $cnt_{mx}$为满分的科目数, $mi$为最低分, $cf$, $cm$为给定系数 枚举满分的个数, 双指针求出最低分的最大值. #include <iostream> #include <sstream> #include <algorithm> #include <cstdio> #include <math.h>…
题目链接:http://codeforces.com/problemset/problem/489/B 题目意思:给出 n 个 boys 的 skills 和 m 个 girls 的 skills,要求成 pair 的条件为,男和女的 skill 差值最多只能为 1.问成 pair 最多是多少. 这个不太难,关键是要考虑周全. 对于某个人,假设他(男)的 skill 值为 i,那么跟他成 pair 的人的 skill 值,只有三种:i-1,i,i+1.跟他成对的女要减少一个.然后女的那边也要搜一…
 Guilty — to the kitchen! Time Limit:2000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit Status Practice CodeForces 42A Description It's a very unfortunate day for Volodya today. He got bad mark in algebra and was therefore forc…
题目链接:http://codeforces.com/contest/489 A:SwapSort In this problem your goal is to sort an array consisting of n integers in at most n swaps. For the given array find the sequence of swaps that makes the array sorted in the non-descending order. Swaps…
Hidden Code 题目连接: http://codeforces.com/gym/100015/attachments Description It's time to put your hacking skills to the test! You've been called upon to help crack enemy codes in the current war on... something or another. Anyway, the point is that yo…
B. Smallest number Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/55/problem/B Description Recently, Vladimir got bad mark in algebra again. To avoid such unpleasant events in future he decided to train his arithmetic skil…
2018-03-03 http://codeforces.com/problemset/problem/937/B B. Vile Grasshoppers time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output The weather is fine today and hence it's high time to climb th…
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…
E. Another Sith Tournament 题目连接: http://www.codeforces.com/contest/678/problem/E Description The rules of Sith Tournament are well known to everyone. n Sith take part in the Tournament. The Tournament starts with the random choice of two Sith who wil…
B. Robin Hood 题目连接: http://www.codeforces.com/contest/671/problem/B Description We all know the impressive story of Robin Hood. Robin Hood uses his archery skills and his wits to steal the money from rich, and return it to the poor. There are n citiz…
B. Jumping Jack 题目连接: http://www.codeforces.com/contest/11/problem/B Description Jack is working on his jumping skills recently. Currently he's located at point zero of the number line. He would like to get to the point x. In order to train, he has d…
E. Two Teams time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output There are nn students standing in a row. Two coaches are forming two teams — the first coach chooses the first team and the sec…
http://codeforces.com/contest/1092/problem/B There are nn students in a university. The number of students is even. The ii-th student has programming skill equal to aiai. The coach wants to form n2n2 teams. Each team should consist of exactly two stu…
传送门: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 …
F. Bear and Fair Set 题目连接: http://www.codeforces.com/contest/628/problem/F Description Limak is a grizzly bear. He is big and dreadful. You were chilling in the forest when you suddenly met him. It's very unfortunate for you. He will eat all your coo…
D. Robin Hood time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output We all know the impressive story of Robin Hood. Robin Hood uses his archery skills and his wits to steal the money from rich, a…
http://codeforces.com/problemset/problem/489/B B. BerSU Ball time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output The Berland State University is hosting a ballroom dance in celebration of its 1…
题目链接:http://codeforces.com/problemset/problem/699/C C. Vacations time limit per test1 second memory limit per test256 megabytes Problem Description Vasya has n days of vacations! So he decided to improve his IT skills and do sport. Vasya knows the fo…
http://codeforces.com/contest/1133/problem/Ctime limit per test 2 secondsmemory limit per test 256 megabytesinputstandard inputoutputstandard output You are a coach at your local university. There are $n$ students under your supervision, the programm…
E - Long Jumps CodeForces - 479D Valery is a PE teacher at a school in Berland. Soon the students are going to take a test in long jumps, and Valery has lost his favorite ruler! However, there is no reason for disappointment, as Valery has found anot…
链接: https://codeforces.com/contest/1216/problem/B 题意: Recently Vasya decided to improve his pistol shooting skills. Today his coach offered him the following exercise. He placed n cans in a row on a table. Cans are numbered from left to right from 1…