Codeforces 158E Phone Talks】的更多相关文章

http://codeforces.com/contest/158/problem/E 题目大意: 麦克是个名人每天都要接n电话,每通电话给出打来的时间和持续时间,麦克可以选择接或不接,但是只能不接k通电话.如果某通电话打来时麦克正在打电话他可以选择让电话排队,或者忽略不接.当麦克空闲时首先从排队的第一个打来的电话开始接起.麦克是个很懒的人,所以需要大量的睡觉,但是睡觉的时间必须是连续的,因此要求出麦克能睡觉的最大连续时间. 思路:dp[i][j]代表前i个电话,不听j个的最少时间,然后枚举即可…
题目链接:http://codeforces.com/problemset/problem/158/E 题意: 你有n个电话要接,每个电话打进来的时刻为第t[i]分钟,时长为d[i]分钟. 每一个电话打进来时,你有两种选择: 将电话挂掉,或接听(如果当时正在打其他电话,则这个电话加入等待队列,等上一个电话打完后立马接听) 你最多能挂掉k个电话. 时间从第1分钟开始算,一直到86400分钟结束,问你能够获得的最长连续间隔为多长时间. 题解: 表示状态: dp[i][j] = clocks 表示打了…
题目链接:http://codeforces.com/contest/158/problem/E 题意:给出一些电话,有打进来的时间和持续的时间,如果人在打电话,那么新打进来的电话入队,如果人没有打电话,那么人必须立即接电话,或者选择一次放弃的机会,问这个最多有多长的连续的空闲的时间. 题解:按照套路最长一般都是依靠dp来求解或者贪心.然后由于数据也就4000所以不难想到设 dp[i][j]表示处理到第i个电话时,无视了j个电话之后最短的结束时间,于是转移方程如下: dp[i][j] = min…
链接:https://codeforces.com/contest/1166/problem/C 题意: The legend of the foundation of Vectorland talks of two integers xx and yy. Centuries ago, the array king placed two markers at points |x||x| and |y||y| on the number line and conquered all the lan…
题目链接:http://codeforces.com/contest/158/problem/E E. Phone Talks time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output Cool J has recently become a businessman Mr. Jackson, and he has to make a l…
上一次我们拿学校的URP做了个小小的demo.... 其实我们还可以把每个学生的证件照爬下来做成一个证件照校花校草评比 另外也可以写一个物理实验自动选课... 但是出于多种原因,,还是绕开这些敏感话题.. 今天,我们来扒一下cf的题面! PS:本代码不是我原创 1. 必要的分析 1.1 页面的获取 一般情况CF的每一个 contest 是这样的: 对应的URL是:http://codeforces.com/contest/xxx 还有一个Complete problemset页面,它是这样的:…
http://codeforces.com/contest/738/problem/D Galya is playing one-dimensional Sea Battle on a 1 × n grid. In this game a ships are placed on the grid. Each of the ships consists of bconsecutive cells. No cell can be part of two ships, however, the shi…
http://codeforces.com/contest/738/problem/C Vasya is currently at a car rental service, and he wants to reach cinema. The film he has bought a ticket for starts in t minutes. There is a straight road of length s from the service to the cinema. Let's…
http://codeforces.com/contest/738/problem/A Polycarp has interviewed Oleg and has written the interview down without punctuation marks and spaces to save time. Thus, the interview is now a string s consisting of n lowercase English letters. There is…
http://codeforces.com/problemset/problem/662/A 题目大意: 给定n(n <= 500000)张卡片,每张卡片的两个面都写有数字,每个面都有0.5的概率是在正面,各个卡牌独立.求把所有卡牌来玩Nim游戏,先手必胜的概率. (⊙o⊙)-由于本人只会在word文档里写公式,所以本博客是图片格式的. Code #include <cstdio> #include <cstring> #include <algorithm> u…