摘要:TramTime Limit: 1000MSMemory Limit: 30000KTotal Submissions: 7180Accepted: 2601DescriptionTram network in Zagreb consists of a number of intersections and rails connecting some of them. In every intersection there is a switch pointing to the one of the rails going out of the intersection. When the t
阅读全文
摘要:Prime TestTime Limit: 6000MSMemory Limit: 65536KTotal Submissions: 24514Accepted: 5730Case Time Limit: 4000MSDescriptionGiven a big integer number, you are required to find out whether it's a prime number.InputThe first line contains the number of test cases T (1 <= T <= 20 ), then the fol
阅读全文
摘要:KindergartenTime Limit: 2000MSMemory Limit: 65536KTotal Submissions: 3866Accepted: 1832DescriptionIn a kindergarten, there are a lot of kids. All girls of the kids know each other and all boys also know each other. In addition to that, some girls and boys know each other. Now the teachers want to pi
阅读全文
摘要:The Perfect StallTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 14447Accepted: 6612DescriptionFarmer John completed his new barn just last week, complete with all the latest milking technology. Unfortunately, due to engineering problems, all the stalls in the new barn are different. For th
阅读全文
摘要:Antenna PlacementTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 4739Accepted: 2359DescriptionThe Global Aerial Research Centre has been allotted the task of building the fifth generation of mobile phone nets in Sweden. The most striking reason why they got the job, is their discovery of a
阅读全文
摘要:AsteroidsTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 10288Accepted: 5556DescriptionBessie wants to navigate her spaceship through a dangerous asteroid field in the shape of an N x N grid (1 <= N <= 500). The grid contains K asteroids (1 <= K <= 10,000), which are convenientl
阅读全文
摘要:Invitation CardsTime Limit: 8000MSMemory Limit: 262144KTotal Submissions: 14556Accepted: 4710DescriptionIn 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. T
阅读全文
摘要:ArbitrageTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 11008Accepted: 4629DescriptionArbitrage is the use of discrepancies in currency exchange rates to transform one unit of a currency into more than one unit of the same currency. For example, suppose that 1 US Dollar buys 0.5 British po
阅读全文
摘要:Stockbroker GrapevineTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 21124Accepted: 11474DescriptionStockbrokers are known to overreact to rumours. You have been contracted to develop a method of spreading disinformation amongst the stockbrokers to give your employer the tactical edge in th
阅读全文
摘要:FroggerTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 17842Accepted: 5818DescriptionFreddy 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' sunsc
阅读全文
摘要:昂贵的聘礼Time Limit: 1000MSMemory Limit: 10000KTotal Submissions: 27365Accepted: 7639Description年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金币,便请求酋长降低要求。酋长说:"嗯,如果你能够替我弄到大祭司的皮袄,我可以只要8000金币。如果你能够弄来他的水晶球,那么只要5000金币就行了。"探险家就跑到大祭司那里,向他要求皮袄或水晶球,大祭司要他用金币来换,或者替他弄来其他的东
阅读全文
摘要:WormholesTime Limit: 2000MSMemory Limit: 65536KTotal Submissions: 20639Accepted: 7342DescriptionWhile 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 BE
阅读全文
摘要:/*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
阅读全文
摘要:LayoutTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 4641Accepted: 2240DescriptionLike everyone else, cows like to stand close to their friends when queuing for feed. FJ has N (2 <= N <= 1,000) cows numbered 1..N standing along a straight line waiting for feed. The cows are standing
阅读全文
摘要:InvestmentTime Limit: 1000MSMemory Limit: 30000KTotal Submissions: 5362Accepted: 1843DescriptionJohn never knew he had a grand-uncle, until he received the notary's letter. He learned that his late grand-uncle had gathered a lot of money, somewhere in South-America, and that John was the only in
阅读全文
摘要:TautologyTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 6088Accepted: 2315DescriptionWFF 'N PROOF is a logic game played with dice. Each die has six faces representing some subset of the possible symbols K, A, N, C, E, p, q, r, s, t. A Well-formed formula (WFF) is any string of these s
阅读全文
摘要:Emag eht htiw Em PlehTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 1950Accepted: 1315DescriptionThis problem is a reverse case of the problem 2996. You are given the output of the problem H and your task is to find the corresponding input.Inputaccording to output of problem 2996.Outputacc
阅读全文
摘要:Help Me with the GameTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 2426Accepted: 1571DescriptionYour task is to read a picture of a chessboard position and print it in the chess notation.InputThe input consists of an ASCII-art picture of a chessboard with chess pieces on positions describ
阅读全文
摘要:Robot MotionTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 7892Accepted: 3812DescriptionA robot has been programmed to follow the instructions in its path. Instructions for the next direction the robot is to move are laid down in a grid. The possible instructions are N north (up the page)
阅读全文