摘要:/*POJ 1860有多种汇币,汇币之间可以交换,这需要手续费,当你用100A币交换B币时,A到B的汇率是29.75,手续费是0.39,那么你可以得到(100 - 0.39) * 29.75 = 2963.3975 B币。问s币的金额经过交换最终得到的s币金额数能否增加货币的交换是可以重复多次的,所以我们需要找出是否存在正权回路,且最后得到的s金额是增加的怎么找正权回路呢?(正权回路:在这一回路上,顶点的权值能不断增加即能一直进行松弛)关键在于反向利用Bellman-Ford算法单源最短路径算法,因为题目可能存在负边,所以用Bellman Ford算法,原始Bellman Ford可以用来求负
阅读全文
摘要:CandiesTime Limit: 1500MSMemory Limit: 131072KTotal Submissions: 18737Accepted: 4930DescriptionDuring the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse’s class a large bag of candies and had flymouse distribute them. All the kids
阅读全文
摘要:0 or 1Time Limit: 4000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 692Accepted Submission(s): 185Problem DescriptionGiven a n*n matrix Cij (1<=i,j<=n),We want to find a n*n matrix Xij (1<=i,j<=n),which is 0 or 1.Besides,Xij meets the following condi
阅读全文
摘要:Colored SticksTime Limit: 5000MSMemory Limit: 128000KTotal Submissions: 24748Accepted: 6519DescriptionYou are given a bunch of wooden sticks. Each endpoint of each stick is colored with some color. Is it possible to align the sticks in a straight line such that the colors of the endpoints that touch
阅读全文