ZCMU-1149】的更多相关文章

题目链接:http://lightoj.com/volume_showproblem.php?problem=1149 Description You will be given two sets of integers. Let's call them set A and set B. Set A contains n elements and set B contains m elements. You have to remove k1 elements from set A and k2…
题目大意:是有M个猪圈,N个顾客,顾客要买猪,神奇的是顾客有一些猪圈的钥匙而主人MIRKO却没有钥匙,多么神奇?顾客可以在打开的猪圈购买任意数量的猪,只要猪圈里有足够数量的猪.而且当顾客打开猪圈后mirko就可以在打开的猪圈之间任意调整猪的数量,(顾客走了之后猪圈要关闭).问mirko怎样做能使顾客买到最多的猪 思路如下:(也是查的,具体原理和原因明天更新) 1.取超级源点和超级汇点: 2.当猪圈被第一次打开时,在源点与当前顾客之间连接一条边,容量为该猪圈的猪的头数: 3.当某个猪圈 不是被第一…
题目链接:http://poj.org/problem?id=1149 #include <cstdio> #include <cmath> #include <algorithm> #include <iostream> #include <cstring> #include <queue> #include <vector> #define maxn 1050 #define maxe 200000 using nam…
Let An = sin(1–sin(2+sin(3–sin(4+…sin(n))…)Let Sn = (…(A1+n)A2+n–1)A3+…+2)An+1For given N print SN Input One integer N. 1 ≤ N ≤ 200 Output Line containing SN Sample input output 3 ((sin(1)+3)sin(1–sin(2))+2)sin(1–sin(2+sin(3)))+1 Problem Author: Vlad…
首先来认识一下网络流中最大流的问题 给定一个有向图G=(V,E),把图中的边看做成管道,边权看做成每根管道能通过的最大流量(容量),给定源点s和汇点t,在源点有一个水源,在汇点有一个蓄水池,问s-t的最大水流量是多少 网络流图里,源点流出的量等于汇点流入的量,除源汇外的任何点,其流入量之和等于流出量之和 . 首先我们来看下面的图 s是源点,t是汇点 先这么想,先用dfs找出一条从s-t的路线,把他塞满,然后流量就是路径中容量最小的那条路的容量,然后把路径上的容量都剪去这个流量,再重新从s-t找可…
http://acm.zcmu.edu.cn/JudgeOnline/problem.php?id=1894 题意: 有M个鹰蛋,N层楼,鹰蛋的硬度是E,也就是说在1~E层楼扔下去不会碎,E+1层楼扔下去会碎. 给定M,N,问最坏情况下至少几次能得到E的具体的值.(E可能为0) ①n<=100. ②n<=1000. ③n<=100000. ④n<=1000000. ⑤n<=1000000000.   推荐学习资料: 朱晨光IOI2004集训队论文 从<鹰蛋>一题浅…
传送门: http://acm.zcmu.edu.cn/JudgeOnline/problem.php?id=2177 2177: Lucky Numbers (easy) 时间限制: 2 Sec  内存限制: 256 MB提交: 42  解决: 21[提交][状态][讨论版] 题目描述 time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard ou…
http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1149 F(x) = 1 (0 <= x < 4) F(x) = F(x - 1) + F(x - pi) (4 <= x) Pi = 3.1415926535..... 现在给出一个N,求F(N).由于结果巨大,只输出Mod 10^9 + 7的结果即可. 不好想啊……以及我曾经打了个表,并且还找到了规律,结果过到29就gg了…… 参考:https://www.c…
POJ - 1149 思路: 最大流: 代码: #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; #define maxn 105 #define maxm 1005 #define maxque 200005 #define INF 0x7fffffff int n,m,val[maxm],last[maxm]…
PIGS Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 20738   Accepted: 9481 Description Mirko works on a pig farm that consists of M locked pig-houses and Mirko can't unlock any pighouse because he doesn't have the keys. Customers come t…