![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ACM
文章平均质量分 81
旻宇
New Acmer
展开
-
POJ1419 Graph Coloring
DescriptionYou are to write a program that tries to find an optimal coloring for a given graph. Colors are applied to the nodes of the graph and the only available colors are black and white. The co原创 2015-08-19 17:10:17 · 600 阅读 · 0 评论 -
uva10910 - Marks Distribution
URL: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1851原创 2014-07-14 15:39:11 · 444 阅读 · 0 评论 -
POJ1286 Necklace of Beads
DescriptionBeads of red, blue or green colors are connected together into a circular necklace of n beads ( n < 24 ). If the repetitions that are produced by rotation around the center of the circula原创 2014-06-22 23:56:29 · 511 阅读 · 0 评论 -
poj1065 Wooden Sticks
Wooden SticksTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 17946 Accepted: 7516DescriptionThere is a pile of n wooden sticks. The length and weight of e原创 2014-06-20 21:14:23 · 564 阅读 · 0 评论 -
poj1477 Box of Bricks
在OJ题目分类的网页上找到这个题原创 2014-06-20 17:54:41 · 503 阅读 · 0 评论 -
ZOJ2110 Tempter of the Bone
URL:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1110原创 2014-07-28 22:34:32 · 442 阅读 · 0 评论 -
poj 2262 Goldbach's Conjecture 素数筛
DescriptionIn 1742, Christian Goldbach, a German amateur mathematician, sent a letter to Leonhard Euler in which he made the following conjecture:Every even number greater than 4 can bewritten原创 2014-07-26 21:16:03 · 515 阅读 · 0 评论 -
Uva10533 - Digit Primes
A prime number is a positive number, which is divisible by exactly two different integers. A digit prime is a prime number whose sum of digits is also prime. For example the prime number 41 is a dig原创 2014-07-26 22:25:02 · 617 阅读 · 0 评论 -
POJ 1659 Frogs' Neighborhood Havel-Hakimi定理
UDescription未名湖附近共有N个大小湖泊L1, L2, ..., Ln(其中包括未名湖),每个湖泊Li里住着一只青蛙Fi(1 ≤ i ≤ N)。如果湖泊Li和Lj之间有水路相连,则青蛙Fi和Fj互称为邻居。现在已知每只青蛙的邻居数目x1, x2, ..., xn,请你给出每两个湖泊之间的相连关系。Input第一行是测试数据的组数T(0 ≤ T ≤ 20)。原创 2014-07-27 19:58:34 · 517 阅读 · 0 评论 -
Uva 10168 - Summation of Four Primes
URL: Euler proved in one of his classic theorems that prime numbers are infinite in number. But can every number be expressed as a summation of four positive primes? I don’t know the answer. May b原创 2014-07-26 21:51:34 · 572 阅读 · 0 评论 -
POJ1185 炮兵阵地
Description司令部的将军们打算在N*M的网格地图上部署他们的炮兵部队。一个N*M的地图由N行M列组成,地图的每一格可能是山地(用"H" 表示),也可能是平原(用"P"表示),如下图。在每一格平原地形上最多可以布置一支炮兵部队(山地上不能够部署炮兵部队);一支炮兵部队在地图上的攻击范围如图中黑色区域所示: 如果在地图中的灰色所标识的平原上部署一支炮兵部队,则原创 2014-07-15 13:57:44 · 521 阅读 · 0 评论 -
SOJ1824: The Suspects
URL: http://cstest.scu.edu.cn/soj/problem.action?id=1824原创 2014-07-15 20:51:08 · 473 阅读 · 0 评论 -
POJ1716 Integer Intervals
URL: http://poj.org/problem?id=1716原创 2014-07-13 22:27:14 · 464 阅读 · 0 评论 -
POJ1776 Task Sequences
URL:http://poj.org/problem?id=1776DescriptionTom has received a lot of tasks from his boss, which are boring to deal with by hand. Fortunately,Tom got a special machine - Advanced Computing Mach原创 2015-08-18 21:31:11 · 724 阅读 · 0 评论 -
uva216 Getting in Line
Computer networking requires that the computers in the network be linked.This problem considers a ``linear" network in which the computers are chained together so that each is connected to exactly t原创 2015-08-18 20:23:52 · 440 阅读 · 0 评论 -
POJ2337/UVA10441 Catenyms
URL:http://poj.org/problem?id=2337URL:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=16&page=show_problem&problem=1382DescriptionA catenym is a pair of words原创 2015-08-18 13:46:37 · 511 阅读 · 0 评论 -
POJ3667 Hotel
URL:http://poj.org/problem?id=3667DescriptionThe cows are journeying north to Thunder Bay in Canada to gain cultural enrichment and enjoy a vacation on the sunny shores of Lake Superior. Bes原创 2015-08-17 11:02:39 · 369 阅读 · 0 评论 -
POJ2528 Mayor's posters
URL:http://poj.org/problem?id=2528DescriptionThe citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all p原创 2015-08-16 17:22:47 · 341 阅读 · 0 评论 -
uva10405 - Longest Common Subsequence
URL:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1346原创 2014-07-15 14:56:07 · 415 阅读 · 0 评论 -
ZOJ1649 Rescue 路径深度图算法
Time Limit: 2 Seconds Memory Limit: 65536 KBAngel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M Angel's friends want to save Angel. Th原创 2014-08-11 18:12:05 · 536 阅读 · 0 评论 -
ZOJ1008 Gnome Tetravex DFS
URL: Time Limit: 10 Seconds Memory Limit: 32768 KB原创 2014-08-10 10:47:46 · 496 阅读 · 0 评论 -
POJ1458 Common Subsequence
URL : http://poj.org/problem?id=1458原创 2014-07-14 20:54:14 · 393 阅读 · 0 评论 -
hdu4292 Food 网络最大流 拆点
Problem Description You, a part-time dining service worker in your college’s dining hall, are now confused with a new problem: serve as many people as possible. The issue comes up as people in y原创 2014-07-26 17:21:10 · 523 阅读 · 0 评论 -
POJ 3436 ACM Computer Factory
DescriptionAs you know, all the computers used for ACM contests must be identical, so the participants compete on equal terms. That is why all these computers are historically produced at the same原创 2014-07-25 21:29:10 · 497 阅读 · 0 评论 -
POJ1459 Power Network
DescriptionA power network consists of nodes (power stations, consumers and dispatchers) connected by power transport lines. A node u may be supplied with an amount s(u) >= 0 of power, may produce a原创 2014-07-24 22:10:11 · 447 阅读 · 0 评论 -
hdu2187 悼念512汶川大地震遇难同胞——老人是真饿了
贪心法水题,代码如下:#include #include struct rice{ int p, w;}r[1010];bool cmp(rice x, rice y){ return x.p } int main(){ int c, n, i, t, m; double ans; scanf("%d原创 2014-07-16 22:43:47 · 525 阅读 · 0 评论 -
带权二分图最佳匹配KM算法模板
KM算法是在匈牙利算法的基础上扩展出来的,原创 2014-06-05 23:02:38 · 999 阅读 · 0 评论 -
二分图最大匹配
POJ 1274 The Perfect Stall原创 2014-07-17 14:21:37 · 407 阅读 · 0 评论 -
关于素数
一、素数筛(1) 埃拉托斯特尼筛法for ( int i = 2; i for ( int i = 2; i if( u[i] ) for( int j = 2; j*i u[i*j] = false;for ( int i = 2 , num = 0; i if( u原创 2014-07-16 18:33:23 · 419 阅读 · 0 评论 -
POJ2481 Cows
DescriptionFarmer John's cows have discovered that the clover growing along the ridge of the hill (which we can think of as a one-dimensional number line) in his field is particularly good. Fa原创 2014-07-16 14:53:29 · 496 阅读 · 0 评论 -
Uva 11997 - K Smallest Sums
URL: Problem KK Smallest SumsYou're given k arrays, each array has k integers. There are kk ways to pick exactly one element in each array and calculate the sum of the integers. Your ta原创 2014-07-15 19:26:40 · 489 阅读 · 0 评论 -
POJ1274 The Perfect Stall
原题链接: http://poj.org/problem?id=1274原创 2014-06-04 23:15:32 · 455 阅读 · 0 评论 -
POJ2662 A Walk Through the Forest
URL: http://poj.org/problem?id=2662v原创 2014-07-14 13:52:26 · 529 阅读 · 0 评论 -
uva10534 hdu2198 双向LIS问题
LIS问题算是DP中很基础很简单的一类问题,其经典算法时间复杂度为O(n^2);利用它本身的特点,结合二分法,即可设计出时间复杂度为O(n*log n)的优化算法。LIS的变形好像不太多,下面是两个很相似的双向LIS问题,其实第二个题的代码是直接用第一个题的代码改的。uva10543:http://uva.onlinejudge.org/index.php?option=com_onl原创 2014-05-13 17:40:17 · 1021 阅读 · 0 评论 -
POJ1323 Game Prediction
DescriptionSuppose there are M people, including you, playing a special card game. At the beginning, each player receives N cards. The pip of a card is a positive integer which is at most N*M. And原创 2014-07-16 20:58:38 · 533 阅读 · 0 评论 -
HOJ1941 超市收银问题
L最近在工大外面开了一个小超市。由于该超市物美价廉,且服务态度热情,因此刚开业就十分火爆。可是,这个超市目前只有两个收银台,以至于最近经常有顾客抱怨等待交款的时间太长。这个超市目前暂时没有办法增加新的收银台,因此,L想通过别的办法缓解这个问题。现在,假设有N个顾客在等待交款。显然,前两个顾客可以马上得到服务,而后面的就得排队等候。L想重新调整一下两支队伍,使得这N个顾客们的平均等待时间最小。假原创 2014-07-16 21:51:05 · 1439 阅读 · 0 评论 -
POJ2828 Buy Tickets
URL: http://poj.org/problem?id=2828原创 2014-07-16 16:27:34 · 430 阅读 · 0 评论 -
POJ1149 PIGS 网络最大流
DescriptionMirko 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 to the farm one after another. Each o原创 2014-07-21 21:38:36 · 529 阅读 · 1 评论 -
ACM中无穷大的设置
如果问题中各数据的范围明确,那么无穷大的设定不是问题,在不明确的情况下,很多程序员都取0x7fffffff作为无穷大,因为这是32-bit int的最大值。如果这个无穷大只用于一般的比较(比如求最小值时min变量的初值),那么0x7fffffff确实是一个完美的选择,但是在更多的情况下,0x7fffffff并不是一个好的选择。很多时候我们并不只是单纯拿无穷大来作比较,而是会运算后再做比较,例如在大转载 2014-07-18 23:47:13 · 1958 阅读 · 0 评论 -
POJ2287/UVA1344 Tian Ji -- The Horse Racing
DescriptionHere is a famous story in Chinese history. That was about 2300 years ago. General Tian Ji was a high official in the country Qi. He likes to play horse racing with the king and others.原创 2014-05-18 17:27:58 · 631 阅读 · 0 评论