最短路Time Limit: 5000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 13761Accepted Submission(s): 5856Problem Description在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找最短的从商店到赛场的路线,你可以帮助他们吗?Input输入包括多组数据。每组数据第一行是两个整数N、M(N<=100,M Read More
posted @ 2012-07-27 10:53 jiai Views(165) Comments(0) Diggs(0) Edit
OJ Problem Set - 1610Count the ColorsTime Limit:2 Seconds Memory Limit:65536 KBPainting some colored segments on a line, some previously painted segments may be covered by some the subsequent ones.Your task is counting the segments of different colors you can see at last.InputThe first line of each Read More
posted @ 2012-07-26 22:11 jiai Views(158) Comments(0) Diggs(0) Edit
Count ColorTime Limit:1000MSMemory Limit:65536KTotal Submissions:26845Accepted:8023DescriptionChosen Problem Solving and Program design as an optional course, you are required to solve all kinds of problems. Here, we get a new problem.There is a very long board with length L centimeter, L is a posit Read More
posted @ 2012-07-26 20:10 jiai Views(142) Comments(0) Diggs(0) Edit
Just a HookTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 8647Accepted Submission(s): 4195Problem DescriptionIn the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecut Read More
posted @ 2012-07-25 18:02 jiai Views(238) Comments(0) Diggs(0) Edit
I Hate ItProblem Description很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。这让很多学生很反感。不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。Input本题目包含多组测试,请处理到文件结束。在每个测试的第一行,有两个正整数 N 和 M ( 0<N<=200000,0<M<5000 ),分别代表学生的数目和操作的数目。学生ID编号分别从1编到N。第二行包含N个整数,代表这N个学生的初始成绩,其中第i个数代表ID为i的学生的成绩。接下来有 Read More
posted @ 2012-07-25 15:32 jiai Views(317) Comments(0) Diggs(0) Edit
Balanced LineupTime Limit:5000MSMemory Limit:65536KTotal Submissions:23316Accepted:10844Case 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 Read More
posted @ 2012-07-25 14:33 jiai Views(172) Comments(0) Diggs(0) Edit
Lost CowsTime Limit:1000MSMemory Limit:65536KTotal Submissions:7310Accepted:4658DescriptionN (2 <= N <= 8,000) cows have unique brands in the range 1..N. In a spectacular display of poor judgment, they visited the neighborhood 'watering hole' and drank a few too many beers before dinne Read More
posted @ 2012-07-25 11:16 jiai Views(325) Comments(0) Diggs(0) Edit
A Simple Problem with IntegersTime Limit:5000MSMemory Limit:131072KTotal Submissions:32903Accepted:9360Case Time Limit:2000MSDescriptionYou haveNintegers,A1,A2, ... ,AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interva Read More
posted @ 2012-07-25 10:20 jiai Views(203) Comments(0) Diggs(0) Edit
CipherDescriptionBob and Alice started to use a brand-new encoding scheme. Surprisingly it is not a Public Key Cryptosystem, but their encoding and decoding is based on secret keys. They chose the secret key at their last meeting in Philadelphia on February 16th, 1996. They chose as a secret key a.. Read More
posted @ 2012-07-24 17:49 jiai Views(159) Comments(0) Diggs(0) Edit
A Famous GridProblem DescriptionMr. B has recently discovered the grid named "spiral grid".Construct the grid like the following figure. (The grid is actually infinite. The figure is only a small part of it.)Considering traveling in it, you are free to any cell containing a composite numbe Read More
posted @ 2012-07-24 17:40 jiai Views(205) Comments(0) Diggs(0) Edit