摘要:B. Valera and Contesttime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputValera loves to participate in competitions. Especially in programming contests. Today he has participated in the contest with his team, consisting ofnstudents (including Valera)
阅读全文
摘要:C. Valera and Electionstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe city Valera lives in is going to hold elections to the city Parliament.The city hasndistricts andn - 1bidirectional roads. We know that from any district there is a path al
阅读全文
摘要:G -Jeff and FurikTime Limit:1000MSMemory Limit:262144KB64bit IO Format:%I64d & %I64uSubmitStatusAppoint description:DescriptionJeff has become friends with Furik. Now these two are going to play one quite amusing game.At the beginning of the game Jeff takes a piece of paper and writes down a per
阅读全文
摘要:I -Apple TreeTime Limit:2000MSMemory Limit:262144KB64bit IO Format:%I64d & %I64uSubmitStatusAppoint description:DescriptionYou are given a rooted tree withnvertices. In each leaf vertex there's a single integer — the number of apples in this vertex.Theweightof a subtree is the sum of all num
阅读全文
摘要:D -Levko and Array RecoveryTime Limit:1000MSMemory Limit:262144KB64bit IO Format:%I64d & %I64uSubmitStatusAppoint description:DescriptionLevko loves arraya1, a2, ... , an, consisting of integers, very much. That is why Levko is playing with arraya, performing all sorts of operations with it. Eac
阅读全文
摘要:H -New Year CruiseTime Limit:1000MSMemory Limit:65536KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeURAL 1869DescriptionAnd I drank it straight down.In the life of Russian people there is always a place for a holiday! Even more so when several causes for celebration follow each other— New Ye
阅读全文
摘要:Fibonacci TreeTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 434Accepted Submission(s): 146Problem Description Coach Pang is interested in Fibonacci numbers while Uncle Yang wants him to do some research on Spanning Tree. So Coach Pang decides to.
阅读全文
摘要:B. Sereja and Suffixestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputSereja has an arraya, consisting ofnintegersa1,a2,...,an. The boy cannot sit and do nothing, he decided to study an array. Sereja took a piece of paper and wrote outmintegersl1,
阅读全文
摘要:C. Sereja and Algorithmtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputSereja loves all sorts of algorithms. He has recently come up with a new algorithm, which receives a string as an input. Let's represent the input string of the algorithm a
阅读全文
摘要:A -MatrixTime Limit:1000MSMemory Limit:262144KB64bit IO Format:%I64d & %I64uSubmitStatusAppoint description:DescriptionYou have a string of decimal digitss. Let's definebij = si·sj. Find in matrixbthe number of such rectangles that the sumbijfor all cells(i, j)that are the elements of t
阅读全文
摘要:P -Sereja and ContestTime Limit:2000MSMemory Limit:262144KB64bit IO Format:%I64d & %I64uSubmitStatusAppoint description:DescriptionDuring the last Sereja's Codesecrof round the server crashed many times, so the round was decided to be made unrated for some participants.Let's assume thatn
阅读全文
摘要:Web NavigationTime Limit:1000MSMemory Limit:10000KTotal Submissions:27179Accepted:12164DescriptionStandard web browsers contain features to move backward and forward among the pages recently visited. One way to implement these features is to use two stacks to keep track of the pages that can be reac
阅读全文
摘要:A. Strange Additiontime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputUnfortunately, Vasya can only sum pairs of integers (a,b), such that for any decimal place at least one number has digit0in this place. For example, Vasya can sum numbers505and50,
阅读全文
摘要:A -Pair of NumbersTime Limit:2000MSMemory Limit:262144KB64bit IO Format:%I64d & %I64uSubmitStatusAppoint description:DescriptionSimon has an arraya1, a2, ..., an, consisting ofnpositive integers. Today Simon asked you to find a pair of integersl, r(1 ≤ l ≤ r ≤ n), such that the following conditi
阅读全文
摘要:I -Biridian ForestTime Limit:2000MSMemory Limit:262144KB64bit IO Format:%I64d & %I64uSubmitStatusAppoint description:DescriptionYou're a mikemon breeder currently in the middle of your journey to become a mikemon master. Your current obstacle is go through the infamous Biridian Forest.The fo
阅读全文
摘要:D. Block Towertime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAfter too much playing on paper, Iahub has switched to computer games. The game he plays is called "Block Towers". It is played in a rectangular grid withnrows andmcolumns (i
阅读全文
摘要:K -Magic FiveTime Limit:1000MSMemory Limit:262144KB64bit IO Format:%I64d & %I64uSubmitStatusAppoint description:DescriptionThere is a long platescontainingndigits. Iahub wants to delete some digits (possibly none, but he is not allowed to delete all the digits) to form his "magic number&quo
阅读全文
摘要:K -Building designingTime Limit:3000MSMemory Limit:0KB64bit IO Format:%lld & %lluSubmitStatusDescriptionBuilding designingAn architect wants to design a very high building. The building will consist of some floors, and each floor has a certain size. The size of a floor must be greater than the s
阅读全文
摘要:M -Ciel and DuelTime Limit:2000MSMemory Limit:262144KB64bit IO Format:%I64d & %I64uSubmitStatusAppoint description:DescriptionFox Ciel is playing a card game with her friend Jiro.Jiro hasncards, each one has two attributes:position(Attack or Defense) andstrength. Fox Ciel hasmcards, each one has
阅读全文
摘要:L -Black-and-White CubeTime Limit:1000MSMemory Limit:262144KB64bit IO Format:%I64d & %I64uSubmitStatusAppoint description:DescriptionYou are given a cube of sizek × k × k, which consists of unit cubes. Two unit cubes are considered neighbouring, if they have common face.Your task is to
阅读全文
摘要:O -Ciel and RobotTime Limit:1000MSMemory Limit:262144KB64bit IO Format:%I64d & %I64uSubmitStatusAppoint description:DescriptionFox Ciel has a robot on a 2D plane. Initially it is located in (0, 0). Fox Ciel code a command to it. The command was represented by strings. Each character ofsis one mo
阅读全文
摘要:B. Levko and Permutationtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputLevko loves permutations very much. A permutation of lengthnis a sequence of distinct positive integers, each is at mostn.Let’s assume that valuegcd(a, b)shows the greatest co
阅读全文
摘要:P -Psychos in a LineTime Limit:1000MSMemory Limit:262144KB64bit IO Format:%I64d & %I64uSubmitStatusAppoint description:DescriptionThere arenpsychos standing in a line. Each psycho is assigned a unique integer from1ton. At each step every psycho who has an id greater than the psycho to his right
阅读全文
摘要:H -PurificationTime Limit:1000MSMemory Limit:262144KB64bit IO Format:%I64d & %I64uSubmitStatusAppoint description:DescriptionYou are an adventurer currently journeying inside an evil temple. After defeating a couple of weak zombies, you arrived at a square room consisting of tiles forming ann
阅读全文
摘要:C. Insertion Sorttime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPetya is a beginner programmer. He has already mastered the basics of the C++ language and moved on to learning algorithms. The first algorithm he encountered was insertion sort. Pe
阅读全文
摘要:A. Two Semiknights Meettime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputA boy Petya loves chess very much. He even came up with a chess piece of his own, a semiknight. The semiknight can move in any of these four directions:2squares forward and2squ
阅读全文
摘要:Dummy GuyTime Limit:500MSMemory Limit:65536KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeURAL 1984DescriptionEvery year students of our university participate in Regional Contest in Saint Petersburg. Train journeys from Yekaterinburg to Saint Petersburg make students very thirsty, so they u
阅读全文
摘要:Electrification PlanTime Limit:500MSMemory Limit:65536KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeURAL 1982DescriptionSome country hasncities. The government has decided to electrify all these cities. At first, power stations inkdifferent cities were built. The other cities should be conn
阅读全文
摘要:Parallel and PerpendicularTime Limit:500MSMemory Limit:65536KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeURAL 1981DescriptionYou are given a regularn-gon. Your task is to calculate two values: the number of its diagonals that are parallel to at least one of its other diagonals, and the num
阅读全文
摘要:A. Sorobantime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou know that Japan is the country with almost the largest 'electronic devices per person' ratio. So you might be quite surprised to find out that the primary school in Japan teache
阅读全文
摘要:B. Fencetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere is a fence in front of Polycarpus's home. The fence consists ofnplanks of the same width which go one after another from left to right. The height of thei-th plank ishimeters, disti
阅读全文
摘要:C. Fixing Typostime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputMany modern text editors automatically check the spelling of the user's text. Some editors even suggest how to correct typos.In this problem your task to implement a small function
阅读全文
摘要:D. Renting Bikestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputA group ofnschoolboys decided to ride bikes. As nobody of them has a bike, the boys need to rent them.The renting site offered themmbikes. The renting price is different for different
阅读全文
摘要:Maximum AbsurdityTime Limit:2000MSMemory Limit:262144KB64bit IO Format:%I64d & %I64uSubmitStatusAppoint description:DescriptionReforms continue entering Berland. For example, during yesterday sitting the Berland Parliament approved as much asnlaws (each law has been assigned a unique number from
阅读全文
摘要:H -Penalties KickTime Limit:1000MSMemory Limit:65536KB64bit IO Format:%lld & %lluSubmitStatusDescriptionFootball is an excellent game, but sometimes it is cruel. As you know, two football teams may have a tie after regular time and even addition time, but we have to judge who is the winner, so p
阅读全文
摘要:SecretsDescriptionGerald has been selling state secrets at leisure. All the secrets cost the same:nmarks. The state which secrets Gerald is selling, has no paper money, only coins. But there are coins of all positive integer denominations that are powers of three: 1 mark, 3 marks, 9 marks, 27 marks
阅读全文
摘要:A. Knight Tournamenttime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputHooray! Berl II, the king of Berland is making a knight tournament. The king has already sent the message to all knights in the kingdom and they in turn agreed to participate in
阅读全文
摘要:B. Xenia and Hammingtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputXenia is an amateur programmer. Today on the IT lesson she learned about the Hamming distance.The Hamming distance between two stringss = s1s2...snandt = t1t2...tnof equal lengthn
阅读全文