摘要:Just a HookTime Limit : 4000/2000ms (Java/Other)Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 7Accepted Submission(s) : 4Problem 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 consecutive me
阅读全文
摘要:B. Dima and Sequencetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputDima got into number sequences. Now he's got sequence a1, a2, ..., an, consisting of n positive integers. Also, Dima has got a function f(x), which can be defined with the fo
阅读全文
摘要:A. Dima and Friendstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputDima and his friends have been playing hide and seek at Dima's place all night. As a result, Dima's place got messy. In the morning they decided that they need to clean th
阅读全文
摘要:D. Zero Treetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputA tree is a graph with n vertices and exactly n - 1 edges; this graph should meet the following condition: there exists exactly one shortest (by number of edges) path between any pair of
阅读全文
摘要:C. k-Multiple Free Settime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputA k-multiple free set is a set of integers where there is no pair of integers where one is equal to another integer multiplied by k. That is, there are no two integers x and y
阅读全文
摘要:B. Convex Shapetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputConsider an n × m grid. Initially all the cells of the grid are colored white. Lenny has painted some of the cells (at least one) black. We call a painted grid convex if one can
阅读全文
摘要:A. Lights Outtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLenny is playing a game on a 3 × 3 grid of lights. In the beginning of the game all lights are switched on. Pressing any of the lights will toggle it and all side-adjacent lights.
阅读全文
摘要:D. Good Substringstime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputYou've got string s, consisting of small English letters. Some of the English letters are good, the rest are bad.A substring s[l...r] (1 ≤ l ≤ r ≤ |s|) of string s = s1s2...s|s
阅读全文
摘要:C. Secrettime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe Greatest Secret Ever consists of n words, indexed by positive integers from 1 to n. The secret needs dividing between k Keepers (let's index them by positive integers from 1 to k),
阅读全文
摘要:B. Prime Matrixtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou've got an n × m matrix. The matrix consists of integers. In one move, you can apply a single transformation to the matrix: choose an arbitrary element of the matrix and i
阅读全文
摘要:A. Beautiful Yeartime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIt seems like the year of 2013 came only yesterday. Do you know a curious fact? The year of 2013 is the first year after the old 1987 with only distinct digits.Now you are suggested
阅读全文
摘要:Somali PiratesTime Limit: 1 Second Memory Limit: 32768 KBIt is said that the famous Somali Pirates hate digits. So their QQ passwords never contain any digit. Given some lines of candidate passwords, you are asked to delete all the digits in the passwords and print other characters in their origi...
阅读全文
摘要:Who is Older?Time Limit: 1 Second Memory Limit: 32768 KBJavaman and cpcs are arguing who is older. Write a program to help them.InputThere are multiple test cases. The first line of input is an integer T (0 < T <= 1000) indicating the number of test cases. Then T test cases follow. The i-th li
阅读全文
摘要:CompromiseTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 5181Accepted: 2361Special JudgeDescriptionIn a few months the European Currency Union will become a reality. However, to join the club, the Maastricht criteria must be fulfilled, and this is not a trivial task for the countries (mayb
阅读全文
摘要:Strange Towers of HanoiTime Limit: 1000MSMemory Limit: 30000KTotal Submissions: 2195Accepted: 1446DescriptionBackground Charlie Darkbrown sits in another one of those boring Computer Science lessons: At the moment the teacher just explains the standard Tower of Hanoi problem, which bores Charlie to
阅读全文
摘要:World Cup NoiseTime Limit: 1000MSMemory Limit: 30000KTotal Submissions: 13853Accepted: 6827DescriptionBackground "KO-RE-A, KO-RE-A" shout 54.000 happy football fans after their team has reached the semifinals of the FIFA World Cup in their home country. But although their excitement is rea
阅读全文
摘要:Recaman's SequenceTime Limit: 3000MS Memory Limit: 60000KTotal Submissions: 19147 Accepted: 8028DescriptionThe Recaman's sequence is defined by a0 = 0 ; for m > 0, am = am−1 − m if the rsulting am is positive and not already in the sequence, otherwise am = am−1 + m. The first few numbers
阅读全文
摘要:Function Run FunTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 13734Accepted: 7154DescriptionWe all love recursion! Don't we? Consider a three-parameter recursive function w(a, b, c):if a <= 0 or b <= 0 or c <= 0, then w(a, b, c) returns:1if a > 20 or b > 20 or c > 20
阅读全文
摘要:The TriangleTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 31614Accepted: 18667Description73 88 1 02 7 4 44 5 2 6 5(Figure 1)Figure 1 shows a number triangle. Write a program that calculates the highest sum of numbers passed on a route that starts at the top and ends so...
阅读全文
摘要:SafecrackerTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5240Accepted Submission(s): 2622Problem Description=== Op tech briefing, 2002/11/02 06:42 CST === "The item is locked in a Klein safe behind a painting in the second-floor library. Kle
阅读全文