题目链接 给你n种菜, 每一种可以开始吃的时间不一样, 结束的时间也不一样. 求每种菜吃的时间都相同的最大的时间.时间的范围是0-10000. 看到这个题明显可以想到网络流, 但是时间的范围明显不允许我们把对每一个时间都连边. 那么我们可以对时间的区间连边, 对于一个区间, 如果一盘菜的开始时间>=这个区间的左端点, 结束时间小于右端点, 那么这盘菜就对这个时间段连边, 权值inf.然后每个时间段对汇点t连边, 权值为这段时间的长度. 源点s向每个菜连边, 权值为二分枚举的时间长度, 然后跑最大…
A gourmet came into the banquet hall, where the cooks suggested n dishes for guests. The gourmet knows the schedule: when each of the dishes will be served. For i-th of the dishes he knows two integer moments in time ai and bi (in seconds from the be…
F. Gourmet and Banquet time limit per test 2 seconds memory limit per test 512 megabytes input standard input output standard output A gourmet came into the banquet hall, where the cooks suggested n dishes for guests. The gourmet knows the schedule:…
题目链接:http://codeforces.com/problemset/problem/589/F A gourmet came into the banquet hall, where the cooks suggested n dishes for guests. The gourmet knows the schedule: when each of the dishes will be served. For i-th of the dishes he knows two integ…
题目链接: 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是否满足条件 ,显然,只要给…
题目链接 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 &…
题目链接: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…