摘要:Toy StorageTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 3146Accepted: 1798DescriptionMom and dad have a problem: their child, Reza, never puts his toys away when he is finished playing with them. They gave Reza a rectangular box to put his toys in. Unfortunately, Reza is rebellious and o
阅读全文
摘要:TOYSTime Limit: 2000MSMemory Limit: 65536KTotal Submissions: 8661Accepted: 4114DescriptionCalculate the number of toys that land in each bin of a partitioned toy box. Mom and dad have a problem - their child John never puts his toys away when he is finished playing with them. They gave John a rectan
阅读全文
摘要:这两题是一样的,代码完全一样。就是给了一个连通图,问加多少条边可以变成边双连通。去掉桥,其余的连通分支就是边双连通分支了。一个有桥的连通图要变成边双连通图的话,把双连通子图收缩为一个点,形成一颗树。需要加的边为(leaf+1)/2 (leaf为叶子结点个数)POJ 3177 给定一个连通的无向图G,至少要添加几条边,才能使其变为双连通图。参考:http://blog.csdn.net/lyy289065406/article/details/6762432http://www.cnblogs.com/kuangbin/p/3184889.html#include #include #inclu
阅读全文
摘要:NetworkTime Limit:5000MSMemory Limit:65536KTotal Submissions:5619Accepted:1939DescriptionA network administrator manages a large network. The network consists of N computers and M links between pairs of computers. Any pair of computers are connected directly or indirectly by successive links, so dat
阅读全文
摘要:Network of SchoolsTime Limit:1000MSMemory Limit:10000KTotal Submissions:9073Accepted:3594DescriptionA number of schools are connected to a computer network. Agreements have been developed among those schools: each school maintains a list of schools to which it distributes software (the “receiving sc
阅读全文
摘要:Censored!Time Limit:5000MSMemory Limit:10000KTotal Submissions:6956Accepted:1887DescriptionThe alphabet of Freeland consists of exactly N letters. Each sentence of Freeland language (also known as Freish) consists of exactly M letters without word breaks. So, there exist exactly N^M different Freish
阅读全文
摘要:DNA SequenceTime Limit:1000MSMemory Limit:65536KTotal Submissions:9899Accepted:3717DescriptionIt's well known that DNA Sequence is a sequence only contains A, C, T and G, and it's very useful to analyze a segment of DNA Sequence,For example, if a animal's DNA sequence contains segment AT
阅读全文
摘要:Milking GridTime Limit:3000MSMemory Limit:65536KTotal Submissions:4738Accepted:1978DescriptionEvery morning when they are milked, the Farmer John's cows form a rectangular grid that is R (1 #include #include #include #include using namespace std;char str[10010][100];int R,C;bool same1(int i,int
阅读全文
摘要:The Unique MSTTime Limit:1000MSMemory Limit:10000KTotal Submissions:16984Accepted:5892DescriptionGiven a connected undirected graph, tell if its minimum spanning tree is unique.Definition 1 (Spanning Tree): Consider a connected, undirected graph G = (V, E). A spanning tree of G is a subgraph of G, s
阅读全文
摘要:Borg MazeTime Limit:1000MSMemory Limit:65536KTotal Submissions:6634Accepted:2240DescriptionThe Borg is an immensely powerful race of enhanced humanoids from the delta quadrant of the galaxy. The Borg collective is the term used to describe the group consciousness of the Borg civilization. Each Borg
阅读全文
摘要:昂贵的聘礼Time Limit:1000MSMemory Limit:10000KTotal Submissions:30963Accepted:8737Description年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金币,便请求酋长降低要求。酋长说:"嗯,如果你能够替我弄到大祭司的皮袄,我可以只要8000金币。如果你能够弄来他的水晶球,那么只要5000金币就行了。"探险家就跑到大祭司那里,向他要求皮袄或水晶球,大祭司要他用金币来换,或者替他弄来其他的东西,他可
阅读全文
摘要:SubwayTime Limit:1000MSMemory Limit:65536KTotal Submissions:4928Accepted:1602DescriptionYou have just moved from a quiet Waterloo neighbourhood to a big, noisy city. Instead of getting to ride your bike to school every day, you now get to walk and take the subway. Because you don't want to be la
阅读全文
摘要:CandiesTime Limit:1500MSMemory Limit:131072KTotal Submissions:20067Accepted:5293DescriptionDuring 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 lov
阅读全文
摘要:Invitation CardsTime Limit:8000MSMemory Limit:262144KTotal Submissions:16178Accepted:5262DescriptionIn the age of television, not many people attend theater performances. Antique Comedians of Malidinesia are aware of this fact. They want to propagate theater and, most of all, Antique Comedies. They
阅读全文
摘要:Cow ContestTime Limit:1000MSMemory Limit:65536KTotal Submissions:5989Accepted:3234DescriptionN(1 ≤N≤ 100) cows, conveniently numbered 1..N, are participating in a programming contest. As we all know, some cows code better than others. Each cow has a certain constant skill rating that is unique among
阅读全文
摘要:MPI MaelstromTime Limit:1000MSMemory Limit:10000KTotal Submissions:4017Accepted:2412DescriptionBIT has recently taken delivery of their new supercomputer, a 32 processor Apollo Odyssey distributed shared memory machine with a hierarchical communication subsystem. Valentine McKee's research advis
阅读全文
摘要:WormholesTime Limit:2000MSMemory Limit:65536KTotal Submissions:24249Accepted:8652DescriptionWhile exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path that delivers you to its destination at a time that is BEFORE
阅读全文
摘要:Silver Cow PartyTime Limit:2000MSMemory Limit:65536KTotal Submissions:10147Accepted:4497DescriptionOne cow from each ofNfarms (1 ≤N≤ 1000) conveniently numbered 1..Nis going to attend the big cow party to be held at farm #X(1 ≤X≤N). A total ofM(1 ≤M≤ 100,000) unidirectional (one-way roads connects p
阅读全文
摘要:Heavy TransportationTime Limit:3000MSMemory Limit:30000KTotal Submissions:17314Accepted:4546DescriptionBackgroundHugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man who tells him whether there really is a way from the place his cu
阅读全文
摘要:FroggerTime Limit:1000MSMemory Limit:65536KTotal Submissions:20314Accepted:6601DescriptionFreddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans to visit her, but since the water is dirty and full of tourists' sunscreen
阅读全文