随笔分类 - 网络流
摘要:Golden EggsTime Limit: 6000/3000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 304Accepted Submission(s): 172Problem DescriptionThere is a grid with N rows and M columns. In each cell you can choose to put a golden or silver egg in it, or just leave it empty. If you p
阅读全文
摘要:GameTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 737Accepted Submission(s): 305Problem Descriptiononmylove has invented a game on n × m grids. There is one positive integer on each grid. Now you can take the numbers from the grids to make y
阅读全文
摘要:Strongly connectedTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 437Accepted Submission(s): 193Problem DescriptionGive a simple directed graph with N nodes and M edges. Please tell me the maximum number of the edges you can add that the graph is s
阅读全文
摘要:Ombrophobic BovinesTime Limit:1000MSMemory Limit:65536KTotal Submissions:11651Accepted:2586DescriptionFJ's cows really hate getting wet so much that the mere thought of getting caught in the rain makes them shake in their hooves. They have decided to put a rain siren on the farm to let them know
阅读全文
摘要:FriendshipTime Limit:2000MSMemory Limit:20000KTotal Submissions:8025Accepted:2224DescriptionIn modern society, each person has his own friends. Since all the people are very busy, they communicate with each other only by phone. You can assume that people A can keep in touch with people B, only if1.
阅读全文
摘要:Sightseeing tourTime Limit:1000MSMemory Limit:10000KTotal Submissions:6448Accepted:2654DescriptionThe city executive board in Lund wants to construct a sightseeing tour by bus in Lund, so that tourists can see every corner of the beautiful city. They want to construct the tour so that every street i
阅读全文
摘要:PartyTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3120Accepted Submission(s): 974Problem Description有n对夫妻被邀请参加一个聚会,因为场地的问题,每对夫妻中只有1人可以列席。在2n 个人中,某些人之间有着很大的矛盾(当然夫妻之间是没有矛盾的),有矛盾的2个人是不会同时出现在聚会上的。有没有可能会有n 个人同时列席?Inputn: 表示有n对夫妻被邀请 (n#include#include
阅读全文
摘要:WatchcowTime Limit:3000MSMemory Limit:65536KTotal Submissions:5258Accepted:2206Special JudgeDescriptionBessie's been appointed the new watch-cow for the farm. Every night, it's her job to walk across the farm and make sure that no evildoers are doing any evil. She begins at the barn, makes h
阅读全文
摘要:CatenymsTime Limit:1000MSMemory Limit:65536KTotal Submissions:8173Accepted:2149DescriptionA catenym is a pair of words separated by a period such that the last letter of the first word is the same as the last letter of the second. For example, the following are catenyms:dog.gophergopher.ratrat.tiger
阅读全文
摘要:Ant TripTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 904Accepted Submission(s): 338Problem DescriptionAnt Country consist of N towns.There are M roads connecting the towns.Ant Tony,together with his friends,wants to go through every part of the
阅读全文
摘要:KingTime Limit:1000MSMemory Limit:10000KTotal Submissions:8660Accepted:3263DescriptionOnce, in one kingdom, there was a queen and that queen was expecting a baby. The queen prayed: ``If my child was a son and if only he was a sound king.'' After nine months her child was born, and indeed, sh
阅读全文
摘要:THE MATRIX PROBLEMTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5437Accepted Submission(s): 1372Problem DescriptionYou have been given a matrix CN*M, each element E of CN*Mis positive and no more than 1000, The problem is that if there exist N nu
阅读全文
摘要:Balanced LineupTime Limit:5000MSMemory Limit:65536KTotal Submissions:27567Accepted:12955Case Time Limit:2000MSDescriptionFor the daily milking, Farmer John'sNcows (1 ≤N≤ 50,000) always line up in the same order. One day Farmer John decides to organize a game of Ultimate Frisbee with some of the
阅读全文
摘要:Nearest Common AncestorsTime Limit:1000MSMemory Limit:10000KTotal Submissions:14221Accepted:7596DescriptionA rooted tree is a well-known data structure in computer science and engineering. An example is shown below:In the figure, each node is labeled with an integer from {1, 2,...,16}. Node 8 is the
阅读全文
摘要:Hawk-and-ChickenTime Limit: 6000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1259Accepted Submission(s): 360Problem DescriptionKids in kindergarten enjoy playing a game called Hawk-and-Chicken. But there always exists a big problem: every kid in this game want
阅读全文
摘要:The King’s ProblemTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1142Accepted Submission(s): 424Problem DescriptionIn the Kingdom of Silence, the king has a new problem. There are N cities in the kingdom and there are M directional roads between t
阅读全文
摘要:Summer HolidayTime Limit: 10000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1147Accepted Submission(s): 503Problem DescriptionTo see a World in a Grain of SandAnd a Heaven in a Wild Flower,Hold Infinity in the palm of your handAnd Eternity in an hour.—— William
阅读全文
摘要:Proving EquivalencesTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1842Accepted Submission(s): 698Problem DescriptionConsider the following exercise, found in a generic linear algebra textbook.Let A be an n × n matrix. Prove that the followin
阅读全文
摘要:方格取数(2)Time Limit: 10000/5000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3387Accepted Submission(s): 1045Problem Description给你一个m*n的格子的棋盘,每个格子里面有一个非负数。从中取出若干个数,使得任意的两个数所在的格子没有公共边,就是说所取数所在的2个格子不能相邻,并且取出的数的和最大。Input包括多个测试实例,每个测试实例包括2整数m,n和m*n个非负数(m<=50,n<=50)Ou
阅读全文
摘要:The Bottom of a GraphTime Limit:3000MSMemory Limit:65536KTotal Submissions:7514Accepted:3083DescriptionWe will use the following (standard) definitions from graph theory. LetVbe a nonempty and finite set, its elements being called vertices (or nodes). LetEbe a subset of the Cartesian productV×V
阅读全文