摘要:Theme SectionTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 271Accepted Submission(s): 121Problem DescriptionIt's time for music! A lot of popular musicians are invited to join us in the music festival. Each of them will play one of their repr
阅读全文
摘要:StoneTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 179Accepted Submission(s): 137Problem DescriptionTang and Jiang are good friends. To decide whose treat it is for dinner, they are playing a game. Specifically, Tang and Jiang will alternatively
阅读全文
摘要:Cut the CakeTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 300Accepted Submission(s): 135Problem DescriptionMMM got a big big big cake, and invited all her M friends to eat the cake together. Surprisingly one of her friends HZ took some (N) strawb
阅读全文
摘要:Poker ShuffleTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 95Accepted Submission(s): 24Problem DescriptionJason is not only an ACMer, but also a poker nerd. He is able to do a perfect shuffle. In a perfect shuffle, the deck containing K cards, wh
阅读全文
摘要:FlyerTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 386Accepted Submission(s): 127Problem DescriptionThe new semester begins! Different kinds of student societies are all trying to advertise themselves, by giving flyers to the students for introdu
阅读全文
摘要:Divide GroupsTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 423Accepted Submission(s): 161Problem DescriptionThis year is the 60th anniversary of NJUST, and to make the celebration more colorful, Tom200 is going to invite distinguished alumnus bac
阅读全文
摘要:Count The PairsTime Limit: 20000/10000 MS (Java/Others)Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 277Accepted Submission(s): 150Problem DescriptionWith the 60th anniversary celebration of Nanjing University of Science and Technology coming soon, the university sets n tourist spots
阅读全文
摘要:Walk Through SquaresTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 200Accepted Submission(s): 57Problem DescriptionOn the beaming day of 60th anniversary of NJUST, as a military college which was Second Artillery Academy of Harbin Military Enginee
阅读全文
摘要:Two RabbitsTime Limit: 10000/5000 MS (Java/Others)Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 505Accepted Submission(s): 260Problem DescriptionLong long ago, there lived two rabbits Tom and Jerry in the forest. On a sunny afternoon, they planned to play a game with some stones. The
阅读全文
摘要:MexTime Limit: 15000/5000 MS (Java/Others)Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 623Accepted Submission(s): 209Problem DescriptionMex is a function on a set of integers, which is universally used for impartial game theorem. For a non-negative integer set S, mex(S) is defined a
阅读全文
摘要:Save Labman No.004Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 624Accepted Submission(s): 154Problem DescriptionDue to the preeminent research conducted by Dr. Kyouma, human beings have a breakthrough in the understanding of time and universe. A
阅读全文
摘要:Zhuge Liang's MinesTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 239Accepted Submission(s): 110Problem DescriptionIn the ancient three kingdom period, Zhuge Liang was the most famous and smartest military leader. His enemy was Shima Yi, who a
阅读全文
摘要:Caocao's BridgesTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 194Accepted Submission(s): 89Problem DescriptionCaocao was defeated by Zhuge Liang and Zhou Yu in the battle of Chibi. But he wouldn't give up. Caocao's army still was not
阅读全文
摘要:A Bit FunTime Limit: 5000/2500 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 423Accepted Submission(s): 270Problem DescriptionThere are n numbers in a array, as a0, a1... , an-1, and another number m. We define a function f(i, j) = ai|ai+1|ai+2| ... | aj. Where "
阅读全文
摘要:F(x)Time Limit: 1000/500 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 382Accepted Submission(s): 137Problem DescriptionFor a decimal number x with n digits (AnAn-1An-2... A2A1), we define its weight as F(x) = An* 2n-1+ An-1* 2n-2+ ... + A2* 2 + A1* 1. Now you are giv
阅读全文
摘要:G(x)Time Limit: 2000/500 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 184Accepted Submission(s): 44Problem DescriptionFor a binary number x with n digits (AnAn-1An-2... A2A1), we encode it asWhere "" is bitwise XOR operation and "" indicates the l
阅读全文
摘要:Minimum palindromeTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 260Accepted Submission(s): 127Problem DescriptionSetting password is very important, especially when you have so many "interesting" things in "F:\TDDOWNLOAD".We d
阅读全文
摘要:We Love MOE GirlsTime Limit: 1000/500 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 208Accepted Submission(s): 157Problem DescriptionChikami Nanako is a girl living in many different parallel worlds. In this problem we talk about one of them.In this world, Nanako has
阅读全文
摘要:The LCIS on the TreeTime Limit: 6000/3000 MS (Java/Others)Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 175Accepted Submission(s): 40Problem DescriptionFor a sequence S1, S2, ... , SN, and a pair of integers (i, j), if 1 9 #include 10 #include 11 #include 12 #include 13 #includ...
阅读全文
摘要:The Number Off of FFFTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 78Accepted Submission(s): 36Problem DescriptionX soldiers from the famous "*FFF*army" is standing in a line, from left to right.You, as the captain of*FFF*, decides to h
阅读全文
摘要:Kia's CalculationTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 83Accepted Submission(s): 16Problem DescriptionDoctor Ghee is teaching Kia how to calculate the sum of two integers. But Kia is so careless and alway forget to carry a number when
阅读全文
摘要:The Shortest Path in Nya GraphTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 37Accepted Submission(s): 6Problem DescriptionThis is a very easy problem, your task is just calculate el camino mas corto en un grafico, and just solo hay que cambiar un
阅读全文
摘要:Naive and Silly MugglesTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 24Accepted Submission(s): 17Problem DescriptionThree wizards are doing a experiment. To avoid from bothering, a special magic is set around them. The magic forms a circle, which
阅读全文
摘要:The Moving PointsTime Limit: 6000/3000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 72Accepted Submission(s): 18Problem DescriptionThere are N points in total. Every point moves in certain direction and certain speed. We want to know at what time that the largest dis
阅读全文
摘要:A Computer Graphics ProblemTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 43Accepted Submission(s): 40Problem DescriptionIn this problem we talk about the study of Computer Graphics. Of course, this is very, very hard.We have designed a new mobile
阅读全文
摘要:1811. Longest Common SubstringProblem code: LCSA string is finite sequence of characters over a non-empty finite set Σ.In this problem, Σ is the set of lowercase letters.Substring, also called factor, is a consecutive sequence of characters occurrences at least once in a string.Now your task is simp
阅读全文
摘要:Tree2cycleTime Limit: 15000/8000 MS (Java/Others)Memory Limit: 102400/102400 K (Java/Others)Total Submission(s): 324Accepted Submission(s): 54Problem DescriptionA tree with N nodes and N-1 edges is given. To connect or disconnect one edge, we need 1 unit of cost respectively. The nodes are labeled f
阅读全文
摘要:Difference Between PrimesTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 338Accepted Submission(s): 78Problem DescriptionAll you know Goldbach conjecture.That is to say, Every even integer greater than 2 can be expressed as the sum of two primes. T
阅读全文
摘要:Balls RearrangementTime Limit: 6000/3000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 93Accepted Submission(s): 35Problem DescriptionBob has N balls and A boxes. He numbers the balls from 0 to N-1, and numbers the boxes from 0 to A-1. To find the balls easily, he put
阅读全文
摘要:HerdingTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 415Accepted Submission(s): 59Problem DescriptionLittle John is herding his father's cattles. As a lazy boy, he cannot tolerate chasing the cattles all the time to avoid unnecessary omission
阅读全文
摘要:Rotation Lock PuzzleTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 290Accepted Submission(s): 60Problem DescriptionAlice was felling into a cave. She found a strange door with a number square matrix. These numbers can be rotated around the center
阅读全文
摘要:PetTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 181Accepted Submission(s): 55Problem DescriptionOne day, Lin Ji wake up in the morning and found that his pethamster escaped. He searched in the room but didn’t find the hamster. He tried to use so
阅读全文
摘要:Children's DayTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 158Accepted Submission(s): 72Problem DescriptionToday is Children's Day. Some children ask you to output a big letter 'N'. 'N' is constituted by two vertical line
阅读全文
摘要:Dynamic RankingsTime Limit:10 Seconds Memory Limit:32768 KBThe Company Dynamic Rankings has developed a new kind of computer that is no longer satisfied with the query like to simply find the k-th smallest number of the given N numbers. They have developed a more powerful system such that for N numb
阅读全文
摘要:10628. Count on a treeProblem code: COTYou are given a tree withNnodes.The tree nodes are numbered from1toN.Each node has an integer weight.We will ask you to perform the following operation:u v k: ask for the kth minimum weight on the path from nodeuto nodevInputIn the first line there are two inte
阅读全文
摘要:3267. D-queryProblem code: DQUERYEnglishVietnameseGiven a sequence of n numbers a1, a2, ..., anand a number of d-queries. A d-query is a pair (i, j) (1 ≤ i ≤ j ≤ n). For each d-query (i, j), you have to return the number of distinct elements in the subsequence ai, ai+1, ..., aj.InputLine 1: n (1 ≤ n
阅读全文
摘要:查询区间第K大,而且没有修改。使用划分树是可以做的。作为主席树的入门题,感觉太神奇了,Orz 1 /* *********************************************** 2 Author :kuangbin 3 Created Time :2013-9-4 20:13:20 4 File Name :POJ2104.cpp 5 ************************************************ */ 6 7 #include 8 #include 9 #include 10 #incl...
阅读全文
摘要:1 /* *********************************************** 2 Author :kuangbin 3 Created Time :2013-9-5 9:45:17 4 File Name :F:\2013ACM练习\专题学习\LCA\POJ1330_3.cpp 5 ************************************************ */ 6 7 #include 8 #include 9 #include 10 #include 11 #include 12 #i...
阅读全文
摘要:Closest Common AncestorsTime Limit:2000MSMemory Limit:10000KTotal Submissions:13372Accepted:4340DescriptionWrite a program that takes as input a rooted tree and a list of pairs of vertices. For each pair (u,v) the program determines the closest common ancestor of u and v in the tree. The closest com
阅读全文
摘要:Closest Common AncestorsTime Limit:2000MSMemory Limit:10000KTotal Submissions:13370Accepted:4338DescriptionWrite a program that takes as input a rooted tree and a list of pairs of vertices. For each pair (u,v) the program determines the closest common ancestor of u and v in the tree. The closest com
阅读全文
摘要:Nearest Common AncestorsTime Limit:1000MSMemory Limit:10000KTotal Submissions:14902Accepted:7963DescriptionA 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
阅读全文
摘要:2002: [Hnoi2010]Bounce 弹飞绵羊Time Limit:10 SecMemory Limit:259 MBSubmit:2843Solved:1519[Submit][Status]Description某天,Lostmonkey发明了一种超级弹力装置,为了在他的绵羊朋友面前显摆,他邀请小绵羊一起玩个游戏。游戏一开始,Lostmonkey在地上沿着一条直线摆上n个装置,每个装置设定初始弹力系数ki,当绵羊达到第i个装置时,它会往后弹ki步,达到第i+ki个装置,若不存在第i+ki个装置,则绵羊被弹飞。绵羊想知道当它从第i个装置起步时,被弹几次后会被弹飞。为了使得游戏更有趣,
阅读全文
摘要:Query on The TreesTime Limit: 10000/5000 MS (Java/Others)Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 1527Accepted Submission(s): 747Problem DescriptionWe have met so many problems on the tree, so today we will have a query problem on a set of trees.There are N nodes, each node will
阅读全文
摘要:375. Query on a treeProblem code: QTREEYou are given a tree (an acyclic undirected connected graph) withNnodes, and edges numbered 1, 2, 3...N-1.We will ask you to perfrom some instructions of the following form:CHANGE i ti: change the cost of the i-th edge to tiorQUERY a b: ask for the maximum edge
阅读全文
摘要:2049: [Sdoi2008]Cave 洞穴勘测Time Limit:10 SecMemory Limit:259 MBSubmit:1528Solved:644[Submit][Status]Description辉辉热衷于洞穴勘测。某天,他按照地图来到了一片被标记为JSZX的洞穴群地区。经过初步勘测,辉辉发现这片区域由n个洞穴(分别编号为1到n)以及若干通道组成,并且每条通道连接了恰好两个洞穴。假如两个洞穴可以通过一条或者多条通道按一定顺序连接起来,那么这两个洞穴就是连通的,按顺序连接在一起的这些通道则被称之为这两个洞穴之间的一条路径。洞穴都十分坚固无法破坏,然而通道不太稳定,时常因为外
阅读全文