题目链接: 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…
C - Preparing for the Contest Time Limit:2000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit Status Practice CodeForces 377B Description Soon there will be held the world's largest programming contest, but the testing system sti…
题目描述: Match Points time limit per test 2 seconds memory limit per test 256 mega bytes input standard input output standard output You are given a set of points x1, , ..., *x**n* Two points iand jcan be matched with each other if the following conditi…
(点击此处查看原题) 题意分析 一共有s元钱,要用这些钱给n个人发工资,发给每个人的工资si有最少和最多限制 si ∈[li,ri],在发给n个人的总工资小于s的情况下,要求发给n个人中的工资的中位数最大,并求出这个最大的中位数(数据满足:∑li <= s ) 解题思路 首先注意到发给n个人的工资的中位数mid和n个人所得总工资∑si 具有线性相关性,即 ∑si ∝ mid ,所以我们可以通过二分mid 求出求出满足条件的最优解 随后我们需要判断当前所得的中位数mid是否满足条件 ,显然,只要给…
题 题意 给你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…
题目链接 B Little Dima and Equation 题意:给a, b,c 给一个公式,s(x)为x的各个位上的数字和,求有多少个x. 分析:直接枚举x肯定超时,会发现s(x)范围只有只有1-81,所以枚举一下就行. 在做题的时候,用了pow()错了3次,反正以后不用pow了,还是手写吧.会有误差.pow返回的是double型的. 昨天在b题耽误了好多时间,先是提交错第一组,然后又被人cha了.注意在x在1-10^9之间. #include <iostream> #include &…
B. Tennis Game time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Petya and Gena love playing table tennis. A single match is played according to the following rules: a match consists of mult…
题目链接:http://codeforces.com/problemset/problem/551/C time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Professor GukiZ is concerned about making his way to school, because massive piles of bo…
Intervals 题目连接: http://codeforces.com/gym/100231/attachments Description 给你n个区间,告诉你每个区间内都有ci个数 然后你需要找一个最小的点集,使得满足这n个区间的条件 Input n 然后li,ri,ci Output 输出最小点集大小 Sample Input 5 3 7 3 8 10 3 6 8 1 1 3 1 10 11 1 Sample Output 6 Hint 题意 题解: 线段树+二分+贪心 首先我们贪心一…
题目描述: Maximum Value time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given a sequence a consisting of n integers. Find the maximum possible value of (integer remainder of *a**i* divi…