随笔分类 -  DP

摘要:DescriptionYou are given a number 1 ≤N≤ 50. Every ticket has its 2N-digit number. We call a ticket lucky, if the sum of its firstNdigits is equal to t... 阅读全文
posted @ 2015-05-12 15:21 Painting、时光 阅读(133) 评论(0) 推荐(0)
摘要:DescriptionKolya has returned from a summer camp and now he's a realcommunication fiend. He spends all his free time on the Web chatting with his frie... 阅读全文
posted @ 2015-05-12 12:14 Painting、时光 阅读(136) 评论(0) 推荐(0)
摘要:DescriptionConsider all the sequences with length (0#include#includeusing namespace std;int dp[45][2];int main(){ int n,k; dp[1][0] = dp[1][1]= ... 阅读全文
posted @ 2015-05-10 20:41 Painting、时光 阅读(193) 评论(0) 推荐(0)
摘要:DescriptionThe student Vasechkin was terribly unlucky at his oral examination. Of 42 examination questions, he didn't prepare only the last one, and h... 阅读全文
posted @ 2015-05-10 19:58 Painting、时光 阅读(200) 评论(0) 推荐(0)
摘要:DescriptionBackgroundWe wandered in the labyrinth for twenty minutes before finally entering the large hall. The walls were covered by mirrors here as... 阅读全文
posted @ 2015-05-10 14:35 Painting、时光 阅读(154) 评论(0) 推荐(0)
摘要:DescriptionRest at the sea is wonderful! However, programmer Pasha became awfully bored of lying on a beach in Turkey; so bored that he decided to cou... 阅读全文
posted @ 2015-05-09 18:58 Painting、时光 阅读(237) 评论(0) 推荐(0)
摘要:DescriptionOne curious child has a set ofNlittle bricks (5 ≤N≤ 500). From these bricks he builds different staircases. Staircase consists of steps of ... 阅读全文
posted @ 2015-05-08 21:50 Painting、时光 阅读(266) 评论(0) 推荐(0)
摘要:DescriptionThere live square people in a square country. Everything in this country is square also. Thus, the Square Parliament has passed a law about... 阅读全文
posted @ 2015-05-08 20:27 Painting、时光 阅读(145) 评论(0) 推荐(0)
摘要:Programmers working on a large project have just received a task to write exactlymlines of code. There arenprogrammers working on a project, thei-th o... 阅读全文
posted @ 2015-05-08 19:12 Painting、时光 阅读(158) 评论(0) 推荐(0)
摘要:DescriptionLet’s considerK-based numbers, containing exactlyNdigits. We define a number to be valid if itsK-based notation doesn’t contain two success... 阅读全文
posted @ 2015-05-08 16:41 Painting、时光 阅读(151) 评论(0) 推荐(0)
摘要:DescriptionVasya is the beginning mathematician. He decided to make an important contribution to the science and to become famous all over the world. ... 阅读全文
posted @ 2015-05-07 13:12 Painting、时光 阅读(169) 评论(0) 推荐(0)
摘要:DescriptionFunctioning of a scientific conference is usually divided into several simultaneous sections. For example, there may be a section on parall... 阅读全文
posted @ 2015-05-06 22:06 Painting、时光 阅读(262) 评论(0) 推荐(0)
摘要:DescriptionGiven a 2-dimensional array of positive and negative integers, find the sub-rectangle with the largest sum. The sum of a rectangle is the s... 阅读全文
posted @ 2015-05-06 21:30 Painting、时光 阅读(131) 评论(0) 推荐(0)
摘要:DescriptionMany of SKB Kontur programmers like to get to work by Metro because the main office is situated quite close the station Uralmash. So, since... 阅读全文
posted @ 2015-05-06 20:31 Painting、时光 阅读(179) 评论(0) 推荐(0)
摘要:DescriptionLet’s considerK-based numbers, containing exactlyNdigits. We define a number to be valid if itsK-based notation doesn’t contain two success... 阅读全文
posted @ 2015-05-06 19:41 Painting、时光 阅读(134) 评论(0) 推荐(0)
摘要:DescriptionOn the Day of the Flag of Russia a shop-owner decided to decorate the show-window of his shop with textile stripes of white, blue and red c... 阅读全文
posted @ 2015-05-06 19:11 Painting、时光 阅读(265) 评论(0) 推荐(0)
摘要:DescriptionFarmer John goes to Dollar Days at The Cow Store and discovers an unlimited number of tools on sale. During his first visit, the tools are ... 阅读全文
posted @ 2015-04-29 18:31 Painting、时光 阅读(173) 评论(0) 推荐(0)
摘要:DescriptionNew Zealand currency consists of $100, $50, $20, $10, and $5 notes and $2, $1, 50c, 20c, 10c and 5c coins. Write a program that will determ... 阅读全文
posted @ 2015-04-28 21:35 Painting、时光 阅读(163) 评论(0) 推荐(0)
摘要:DescriptionSuppose there are 5 types of coins: 50-cent, 25-cent, 10-cent, 5-cent, and 1-cent. We want to make changes with these coins for a given amo... 阅读全文
posted @ 2015-04-28 20:40 Painting、时光 阅读(145) 评论(0) 推荐(0)
摘要:140 - The 12th Zhejiang Provincial Collegiate Programming Contest - DBeauty of ArrayTime Limit:2 Seconds Memory Limit:65536 KBEdward has an arrayAwith... 阅读全文
posted @ 2015-04-26 15:39 Painting、时光 阅读(437) 评论(0) 推荐(0)