[题目链接]:http://codeforces.com/contest/807/problem/D [题意] 给出n个人的比赛信息; 5道题 每道题,或是没被解决->用-1表示; 或者给出解题的所用的时间; (每道题的分数与解决率有关,越高,分越低); 然后有个人想利用这个特点,注册很多个账号; 试图改变每道题的解决率,以期让自己的分数大于某个人; 如果这个人没有解决某道题的话; 那些新加入的人也不能解决那道题. 问最少需要注册多少个账号才能让你的分数大于某个人; [题解] 顺序枚举加入了多少…
[题目链接]:http://codeforces.com/contest/527/problem/D [题意] 一维线段上有n个点 每个点有坐标和权值两个域分别为xi,wi; 任意一对点(i,j) 如果|xi-xj|>=wi+wj 则在这两个点之间连一条边; 让你求最大团; 团就是任意两个点之间都有边相连; [题解] |xi-xj|>=wi+wj; 这里的绝对值直接去掉好了: 然后可以变形为 xi-wi>=xj+wj (或者是xj-wj>=xi+wi也没差) 总之就是xi-wi如果…
[题目链接]:http://codeforces.com/contest/793/problem/C [题意] 给你每个点x轴移动速度,y轴移动速度; 问你有没有某个时刻,所有的点都"严格"在所给的矩形内 [题解] 把二维的问题转化成一维的问题; 那样问题就转换成 x1..x2是目标的线段(一维的) 然后有若干个xi 问你从xi变化到到x1..x2这个区间最短和最长时间(分别对应第一次进入这个区间和出这个区间的时间); yi同理; 然后求时间的交集就可以了; 对于都刚好在边框上的情况;…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output There is a polyline going through points (0, 0) – (x, x) – (2x, 0) – (3x, x) – (4x, 0) – - - (2kx, 0) – (2kx + x, x) – -. We know that the polyli…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Bachgold problem is very easy to formulate. Given a positive integer n represent it as a sum of maximum possible number of prime numbers. One can…
题目链接:http://codeforces.com/contest/807/problem/D 题意:对于动态计分的 Codeforces Round ,已知每题的 score 是根据 Round 参加人数和该题过题人数计算,两者之比结合上图得出该题的分数.某人在该题的得分为 score*(1−t/250) 其中 t 表示通过该题的时间. 已知参加该场比赛的所有参加者的过题情况(包括 Vasya 和 Petya),问如何通过增加新的参赛者(尽量少),使得 Vasya 的最终得分高于 Petya…
[链接] 我是链接,点我呀:) [题意] 让你将一个字符串删掉一些字符. 使得字符串中不包含子序列"hard" 删掉每个字符的代价已知为ai 让你求出代价最小的方法. [题解] 设dp[i][j]表示前i个字符,已经和"hard"匹配前j个的最小花费. 对于dp[i][j] 对s[i+1]分类讨论 ①s[i+1]不删 那么有两种情况 第一种:s[i+1]和"hard"的第j+1个字符匹配 第二种:..xxxxx不匹配 则分别转移到dp[i+1][…
地址:http://codeforces.com/contest/807/problem/D 题目: D. Dynamic Problem Scoring time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vasya and Petya take part in a Codeforces round. The round las…
D. Dynamic Problem Scoring time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vasya and Petya take part in a Codeforces round. The round lasts for two hours and contains five problems. For th…
Dynamic Problem Scoring 思路: 水题: 代码: #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; #define maxn 130 ],ac[],cnt,all,last1,last2; ][]; inline void in(int &now) { ;now=; char Cge…