摘要: Problem DescriptionWshxzt is a lovely girl. She likes apple very much. One day HX takes her to an apple tree. There are N nodes in the tree. Each node has an amount of apples. Wshxzt starts her happy trip at one node. She can eat up all the apples in the nodes she reaches. HX is a kind guy. He knows 阅读全文
posted @ 2013-08-21 17:54 persistent codeants 阅读(320) 评论(0) 推荐(0)
摘要: 1128. Partition into GroupsTime limit: 0.5 second Memory limit: 64 MBThere areNchildren in the kindergarten. Unfortunately, the children quarrel though not often. Each child has not more than three adversaries. Is it possible to partition the children into two groups (possibly not equal), so that ea 阅读全文
posted @ 2013-08-21 14:10 persistent codeants 阅读(299) 评论(0) 推荐(0)
摘要: 1160. NetworkTime limit: 1.0 second Memory limit: 64 MBAndrew is working as system administrator and is planning to establish a new network in his company. There will be N hubs in the company, they can be connected to each other using cables. Since each worker of the company must have access to the 阅读全文
posted @ 2013-08-17 12:06 persistent codeants 阅读(338) 评论(0) 推荐(0)
摘要: 1450. Russian PipelinesTime limit: 0.5 second Memory limit: 64 MBBackgroundThe last year developed into a lot of trouble for independent Russia. Bad harvest, bird flu and - to crown it all - the President, who decided to raise funds to buy new balalaika and tame bear for the child of his first cousi 阅读全文
posted @ 2013-08-17 10:37 persistent codeants 阅读(337) 评论(0) 推荐(0)
摘要: 1495. One-two, One-two 2Time limit: 2.0 second Memory limit: 64 MBA year ago the famous gangster Vito Maretti woke up in the morning and realized that he was bored of robbing banks of round sums. And for the last year he has been taking from banks sums that have only digits 1 and 2 in their decimal 阅读全文
posted @ 2013-08-15 19:34 persistent codeants 阅读(428) 评论(0) 推荐(0)
摘要: 1176. HyperchannelsTime limit: 1.0 second Memory limit: 64 MBThe Galaxy Empire consists of N planets. Hyperchannels exist between most of the planets. New Emperor urged to extend hyperchannels network in such a way, that he can move from any planet to any other using no more than one channel. One ca 阅读全文
posted @ 2013-08-15 17:11 persistent codeants 阅读(250) 评论(0) 推荐(0)
摘要: 1320. Graph DecompositionTime limit: 0.5 second Memory limit: 64 MBThere is a simple graph with an even number of edges. You are to define if it is possible to present it by the set of pairs of adjacent edges (having a common vertex).Inputcontains a sequence of the numbers pairs. Each pair denotes v 阅读全文
posted @ 2013-08-15 14:08 persistent codeants 阅读(343) 评论(0) 推荐(0)
摘要: 1651. Shortest SubchainTime limit: 1.0 second Memory limit: 64 MBA chainpis given in a directed graph without loops or multiple edges. It is required to specify its subchainqsuch thatthe initial and final vertices of the chainspandqcoincide;the edges in the chainqare in the same order as in the chai 阅读全文
posted @ 2013-08-15 10:01 persistent codeants 阅读(288) 评论(0) 推荐(0)
摘要: Give you N integers a1, a2 ... aN (|ai| 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 using namespace std; 9 const int inf=-999999999;10 int a[1001];11 int sum[1001]={0};12 int dp1[1001];13 int dp2[1001];14 int n,i,j,k;15 int num;16 int main()17 {18 while(cin>>n&& 阅读全文
posted @ 2013-08-15 08:35 persistent codeants 阅读(254) 评论(0) 推荐(0)
摘要: 1156. Two RoundsTime limit: 2.0 second Memory limit: 64 MBThere are two rounds in the Urals Championship. The competitors have to solveNproblems on each round. The jury had been working hard and finally managed to prepare 2Nproblems for the championship. But it appeared that among those problems the 阅读全文
posted @ 2013-08-14 17:02 persistent codeants 阅读(336) 评论(0) 推荐(0)