摘要:
Broken NecklaceYou have a necklace of N red, white, or blue beads (3<=N<=350) some of which are red, others blue, and others white, arranged at random. Here are two examples for n=29: 1 2 1 2 r b b r b r r b r... 阅读全文
摘要:
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 阅读全文
摘要:
C. Secrettime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe Greatest Secret Ever consists ofnwords, indexed by positive integers from1ton. The secret needs dividing betweenkKeepers (let's index them by positive integers from1tok), thei-th Ke 阅读全文
摘要:
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 阅读全文
摘要:
A. Fancy Fencetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputEmuskald needs a fence around his farm, but he is too lazy to build it himself. So he purchased a fence-building robot.He wants the fence to be a regular polygon. The robot builds the 阅读全文
摘要:
B. Buttonstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputManao is trying to open a rather challenging lock. The lock hasnbuttons on it and to open it, you should press the buttons in a certain order to open the lock. When you push some button, it 阅读全文
摘要:
A. Gamestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputManao works on a sports TV. He's spent much time watching the football games of some country. After a while he began to notice different patterns. For example, each team has two sets of u 阅读全文
摘要:
B. Queue at the Schooltime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputDuring the break the schoolchildren, boys and girls, formed a queue ofnpeople in the canteen. Initially the children stood in the order they entered the canteen. However, after 阅读全文
摘要:
好久不更了 我错了QAQA. Stones on the Tabletime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere arenstones on the table in a row, each of them can be red, green or blue. Count the minimum number of stones to take from the table so that any two neighborin 阅读全文
摘要:
A. Boys and Girlstime limit per test1 secondmemory limit per test256 megabytesinputinput.txtoutputoutput.txtThere arenboys andmgirls studying in the class. They should stand in a line so that boys and girls alternated there as much as possible. Let's assume that positions in the line are indexed 阅读全文