二分枚舉共同工作時間在判斷是否可行即可Body CheckTime Limit: 1 Second Memory Limit: 32768 KB Special JudgeDue to the spread of H1N1 all over the world, the king of Kingdom atouSK is so afraid that he decides to ask all his people to do a body check, no matter
題目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1711題目意思:找出b在a中的起始位置,沒有則是-1解題思路:裸的KMP,不多說不會KMP的話可以去看http://www.cppblog.com/oosky/archive/2006/07/06/9486.html說的非常好模板我是拿的大白的代碼:#include<cstdio>#include<cstring>using namespace std;const int
公式E(x)=n Σ 1/i因為當已經拿到k張不同的時候 拿到不同牌的期望是 (n-k)/n ,1除於這個機率就是 n/(n-k) 然後從1到n加一下就可以了 Problem FCouponsInput: standard inputOutput: standard outputTime Limit: 2 secondsMemory Limit: 32 MB Coupons in cereal boxes are numbered 1 to n, and a set of one of
CompositionsTime Limit: 5 Seconds Memory Limit: 32768 KBWe consider problems concerning the number of ways in which a number can be written as a sum. If the order of the terms in the sum is taken into account the sum is called a composition and
Play with ChainTime Limit: 6000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2720 Accepted Submission(s): 1103Problem DescriptionYaoYao is fond of playing his chains. He has a chain containing n diamonds
很明顯的最小割不同公司訂單分別連源點和匯點,容量是定價然後衝突訂單連邊。容量INF然後總和減去最小割就是答案DuopolyTime Limit: 10 Seconds Memory Limit: 32768 KBTHE 30th ACM/ICPC ASIA REGIONAL 2005 HANGZHOU SITEOnsite Contest SessionProblem D: DuopolyThe mobile network market in country XYZ used to