随笔分类 - 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...
阅读全文
摘要: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...
阅读全文
摘要: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]= ...
阅读全文
摘要:DescriptionThe student Vasechkin was terribly unlucky at his oral examination. Of 42 examination questions, he didn't prepare only the last one, and h...
阅读全文
摘要:DescriptionBackgroundWe wandered in the labyrinth for twenty minutes before finally entering the large hall. The walls were covered by mirrors here as...
阅读全文
摘要: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...
阅读全文
摘要:DescriptionOne curious child has a set ofNlittle bricks (5 ≤N≤ 500). From these bricks he builds different staircases. Staircase consists of steps of ...
阅读全文
摘要:DescriptionThere live square people in a square country. Everything in this country is square also. Thus, the Square Parliament has passed a law about...
阅读全文
摘要: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...
阅读全文
摘要:DescriptionLet’s considerK-based numbers, containing exactlyNdigits. We define a number to be valid if itsK-based notation doesn’t contain two success...
阅读全文
摘要:DescriptionVasya is the beginning mathematician. He decided to make an important contribution to the science and to become famous all over the world. ...
阅读全文
摘要:DescriptionFunctioning of a scientific conference is usually divided into several simultaneous sections. For example, there may be a section on parall...
阅读全文
摘要: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...
阅读全文
摘要: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...
阅读全文
摘要:DescriptionLet’s considerK-based numbers, containing exactlyNdigits. We define a number to be valid if itsK-based notation doesn’t contain two success...
阅读全文
摘要: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...
阅读全文
摘要: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 ...
阅读全文
摘要: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...
阅读全文
摘要: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...
阅读全文
摘要:140 - The 12th Zhejiang Provincial Collegiate Programming Contest - DBeauty of ArrayTime Limit:2 Seconds Memory Limit:65536 KBEdward has an arrayAwith...
阅读全文

浙公网安备 33010602011771号