
DP
文章平均质量分 84
mowayao
这个作者很懒,什么都没留下…
展开
-
POJ3997Stock Chase
Stock ChaseTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 453 Accepted: 129DescriptionI have to admit, the solution I proposed last year for solving the原创 2013-09-26 15:27:32 · 616 阅读 · 0 评论 -
UVa10651 - Pebble Solitaire
Problem APebble SolitaireInput: standard inputOutput: standard outputTime Limit: 1 second Pebble solitaire is an interesting game. This is a game where you are given a board with an arrang原创 2014-03-07 17:53:55 · 786 阅读 · 0 评论 -
UVa11700 - Pipes
Problem B: PipesAfter writing a solver for the "moveable maze" game last week, you have grown tired of it. After all, you already know the optimal solution. To entertain yourself, you find another原创 2014-03-08 15:26:38 · 900 阅读 · 0 评论 -
UVa11153 - Museums
Problem F : MuseumsTime limit: 10 secondsMuseums have been playing a very important role in the development of art and culture in various places around the world. Museums a原创 2014-03-07 15:27:04 · 868 阅读 · 0 评论 -
UVa11725 - Colorful Board(BITMASK+DP)
Colorful BoardInput: Standard InputOutput: Standard Output You are given a board. You are asked to draw M horizontal lines and N vertical lines in that board, so that the whole board原创 2014-03-05 13:41:31 · 1588 阅读 · 0 评论 -
UVa10891 - Game of Sum
Problem EGame of SumInput File: e.inOutput: Standard Output This is a two player game. Initially there are n integer numbers in an array and players A and B get chance to take them alternati原创 2014-03-29 21:26:18 · 642 阅读 · 0 评论 -
UVa10111 - Find the Winning Move
Problem A: Find the Winning MoveSource file:win.{c, cpp, java, pas}Input file:win.inOutput file:win.out4x4 tic-tac-toe is played on a board with four rows (number原创 2014-04-01 12:33:00 · 1061 阅读 · 0 评论 -
LightOJ 1422 - Halloween Costumes
Gappu has a very busy weekend ahead of him. Because, next weekend is Halloween, and he is planning to attend as many parties as he can. Since it's Halloween, these parties are all costume parties, Gap原创 2014-04-19 00:08:15 · 1071 阅读 · 0 评论 -
POJ 1651-Multiplication Puzzle
Multiplication PuzzleTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 5792 Accepted: 3506DescriptionThe multiplication puzzle is played with a row of cards, each containing a single原创 2014-04-19 15:15:12 · 1047 阅读 · 0 评论 -
POJ 2955-Brackets
Language:DefaultBracketsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 2611 Accepted: 1349DescriptionWe give the following inductive definition原创 2014-04-19 12:41:17 · 717 阅读 · 0 评论 -
ZOJ3537 - Cake
CakeTime Limit: 1 Second Memory Limit: 32768 KBYou want to hold a party. Here's a polygon-shaped cake on the table. You'd like to cut the cake into several triangle-shaped parts for the i原创 2014-04-20 21:22:05 · 1042 阅读 · 0 评论 -
UVa11555 - Aspen Avenue
Aspen Avenue ``Phew, that was the last one!'' exclaimed the garden helper Tim as he threw the last tree plant to the ground. His employer, countess Esmeralda Hunt who owned the estate,原创 2014-03-26 11:34:48 · 943 阅读 · 0 评论 -
UVa11324 - The Largest Clique(DAG+DP+SCC)
Problem B: The Largest CliqueGiven a directed graph G, consider the following transformation. First, create a new graph T(G) to have the same vertex set as G. Create a directed edge between two ve原创 2014-08-05 17:19:34 · 633 阅读 · 0 评论 -
POJ3071-Football(概率DP+滚动数组)
FootballTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 2769 Accepted: 1413DescriptionConsider a single-elimination football tournament involving 2n t原创 2014-06-21 15:18:10 · 762 阅读 · 0 评论 -
HDU4719-Oh My Holy FFF(DP线段树优化)
Oh My Holy FFFTime Limit: 5000/2500 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 606 Accepted Submission(s): 141Problem DescriptionN soldiers fr原创 2014-08-19 21:04:02 · 1241 阅读 · 0 评论 -
HDU4064 Carcassonne(状态压缩DP)
HDU4064 Carcassonne(状态压缩DP)原创 2014-09-03 18:34:34 · 931 阅读 · 0 评论 -
Ural 1309 Dispute (递推)
题意:给你一个数列:f(0) = 0f(n) = g(n,f(n-1))g(x,y) = ((y-1)*x^5+x^3-xy+3x+7y)%9973让你求f(n) n 思路:令m = 9973容易观察g(x,y) = g(x%m,y)f(x+m) = g( (x+m) %m , f(x+m-1))........可以得到 f(x+m) = (A*f原创 2014-11-09 19:27:58 · 1177 阅读 · 0 评论 -
UVa10645 - Menu
Menu Input: standard inputOutput: standard outputTime Limit: 10 secondsAlfred wants to plan what to cook in the next days. He can cook various dishes. For each dish the costs of原创 2014-03-02 13:30:51 · 1034 阅读 · 0 评论 -
UVa11578 - Situp Benches
Problem B: Situp BenchesThe gym at the University of Alberta has two identical sit up benches that are side by side. Each of these benches can be inclined in 10 degree increments between 10 degree原创 2014-03-02 14:39:38 · 819 阅读 · 0 评论 -
URAL1018. Binary Apple Tree
Let's imagine how apple tree looks in binary computer world. You're right, it looks just like a binary tree, i.e. any biparous branch splits up to exactly two new branches. We will enumerate by intege原创 2013-11-08 18:26:21 · 806 阅读 · 0 评论 -
ZOJ3216Compositions
We consider problems concerning the number of ways in which a number can be written as a sum. If the order of the terms in the sum is taken into account the sum is called a composition and the numbe原创 2013-11-10 10:47:53 · 774 阅读 · 0 评论 -
URAL1036Lucky Tickets(DP+高精度)
You are given a number 1 ≤ N ≤ 50. Every ticket has its 2N-digit number. We call a ticket lucky, if the sum of its first N digits is equal to the sum of its last N digits. You are also given the sum原创 2013-11-11 13:20:13 · 709 阅读 · 0 评论 -
Ural1039. Anniversary Party
BackgroundThe president of the Ural State University is going to make an 80'th Anniversary party. The university has a hierarchical structure of employees; that is, the supervisor relation forms a原创 2013-11-11 23:38:05 · 1314 阅读 · 0 评论 -
UVa11341 Term Strategy
B - Term StrategyTime Limit: 1 sec Memory Limit: 16MBStudent Peter was playing billiard all the term and for that reason he missed all his lectures. Unfortunately that's the time for term ex原创 2014-01-23 12:07:53 · 903 阅读 · 0 评论 -
UVa10665 Diatribe against Pigeonholes
Diatribe against Pigeonholes BackgroundIn an anonymous town there is a carpenter, the only one in many kilometres, specialized in making pieces of furniture (and famous for being a bit s原创 2014-01-25 13:40:17 · 921 阅读 · 0 评论 -
UVa11400 Lighting System Design
Lighting System DesignInput: Standard InputOutput: Standard Output You are given the task to design a lighting system for a huge conference hall. After doing a lot of calculation & sketching,原创 2014-01-25 18:42:45 · 1246 阅读 · 0 评论 -
UVa11285 - Exchange Rates
Problem A: Exchange RatesNow that the Loonie is hovering about par with the Greenback, you have decided to use your $1000 entrance scholarship to engage in currency speculation. So you gaze into a原创 2014-01-26 00:04:06 · 1430 阅读 · 0 评论 -
UVa882 The Mailbox Manufacturers Problem
The Mailbox Manufacturers Problem In the good old days when Swedish children were still allowed to blow up their fingers with fire-crackers, gangs of excited kids would plague certain smaller citi原创 2014-01-26 15:25:12 · 1144 阅读 · 0 评论 -
UVa10599 Robots(II)
Problem KRobots(II)Time Limit1 Second Your company provides robots that can be used to pick up litter from fields after sporting events and concerts. Before robots ar原创 2014-01-29 18:42:38 · 970 阅读 · 0 评论 -
UVa348 - Optimal Array Multiplication Sequence
Optimal Array Multiplication Sequence Given two arrays A and B, we can determine the array C = A B using the standard definition of matrix multiplication:The number of columns in the原创 2014-01-28 16:36:42 · 749 阅读 · 0 评论 -
UVa10654The Uxuhul Voting System
Problem DThe Uxuhul Voting SystemInput: standard inputOutput: standard outputTime Limit: 1 second One of the world's first civilizations was that of the ancient Uxuhul indians, in the jung原创 2014-01-20 12:48:58 · 1132 阅读 · 0 评论 -
UVa11472 - Beautiful Numbers
Problem BBeautiful NumbersTime Limit : 3 seconds An N-based number is beautiful if all of the digits from 0 to N-1 are used in that number and the difference between any原创 2014-02-02 20:01:09 · 897 阅读 · 0 评论 -
UVa11125Arrange Some Marbles
Problem HArrange Some MarblesInput: Standard InputOutput: Standard Output you are given some marbles of n different color. You have to arrange these marbles in a line. The marbles adjacent w原创 2014-01-20 16:35:58 · 880 阅读 · 0 评论 -
UVa11420 - Chest of Drawers
Problem DChest of Drawers Input: Standard InputOutput: Standard Output Figure 1: A chest of drawersA chest of drawers means a wardrobe which has many drawers alig原创 2014-02-01 20:12:30 · 991 阅读 · 0 评论 -
UVa11432 - Busy Programmer
Problem FBusy Programmer Input: Standard InputOutput: Standard Output Our famous programmer Gordov Mia (Mr. Donkey) is having a very busy time in his office. His erratic boss has assigned hi原创 2014-02-03 01:08:22 · 1092 阅读 · 0 评论 -
UVa11126 - Relaxed Golf
Problem IRelaxed Golf Input: Standard InputOutput: Standard Output Golf and sex are about the only thingsyou can enjoy without being good at.Jimmy DemaretRelaxed Golf原创 2014-02-05 16:49:32 · 850 阅读 · 0 评论 -
UVa 12589 Learning Vector
题意:有n个向量(0 思路:先确定一点,对于选出的k个向量,按斜率从大到小的顺序摆放,面积最大。(不然会损失几个平行四边形的面积) 然后DP , DP[id][cur][height] 分别表示前id个向量,已经选出了cur个向量,高度为height的最大面积。面积计算公式为 x0*y0 + 2*x1*y0+x1*y1 + 2*x2*(y0+y1)........用记忆化搜索注意初始化的优化原创 2014-10-11 12:23:31 · 1108 阅读 · 0 评论