dp
ujn20161222
persistence
展开
-
Alice’s Stamps_dp_2018_3_8
Alice likes to collect stamps. She is now at the post office buying some new stamps. There are N different kinds of stamps that exist in the world; they are numbered 1 through N. However, stamps are ...原创 2018-03-10 11:05:59 · 195 阅读 · 0 评论 -
Greatest Common Increasing Subsequence_dp
You are given two sequences of integer numbers. Write a program to determine their common increasing subsequence of maximal possible length. Sequence S 1 , S 2 , . . . ...原创 2018-04-06 16:34:16 · 113 阅读 · 0 评论 -
Blocks _矩阵快速幂dp
Panda has received an assignment of painting a line of blocks. Since Panda is such an intelligent boy, he starts to think of a math problem of painting. Suppose there are N blocks...原创 2018-04-05 21:20:40 · 153 阅读 · 0 评论 -
The King’s Ups and Downs_组合dp
The king has guards of all different heights. Rather than line them up in increasing or decreasing height order, he wants to line them up so each guard is either shorter than the guards next to him ...原创 2018-04-16 21:05:17 · 115 阅读 · 0 评论 -
Coin Changing Problem _dp
Find the minimum number of coins to make change for n cents using coins of denominations d1, d2,.., dm. The coins can be used any number of times. Input n md1 d2 ... dm Two integers n and m ...原创 2018-04-03 15:46:29 · 150 阅读 · 0 评论 -
Matrix Chain Multiplication _dp
Matrix-chain Multiplication The goal of the matrix-chain multiplication problem is to find the most efficient way to multiply given n matrices M1,M2,M3,...,Mn. Write a program which reads dimen...原创 2018-04-03 15:21:07 · 107 阅读 · 0 评论 -
Attack on Titans_dp递推
Over centuries ago, mankind faced a new enemy, the Titans. The difference of power between mankind and their newfound enemy was overwhelming. Soon, mankind was driven to the brink of extinction. Luck...原创 2018-04-15 18:20:42 · 199 阅读 · 0 评论 -
Longest Common Subsequence _dp
For given two sequences X and Y, a sequence Z is a common subsequence of X and Y if Z is a subsequence of both X and Y. For example, if X={a,b,c,b,d,a,b} and Y={b,d,c,a,b,a}, the sequence {b,c,a} is a...原创 2018-04-02 22:26:47 · 296 阅读 · 0 评论 -
Prince and Princess_dp
https://cn.vjudge.net/problem/UVA-10635#相同元素出现的位置//#include<bits/stdc++.h>#include<vector>#include<algorithm>#include<iostream>using namespace std;const int N=250*250+10;...原创 2018-04-15 11:25:12 · 84 阅读 · 0 评论 -
Runner's Problem_矩阵快速幂+dp
getchar()读的快F. Runner's Problemtime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are running through a rectangular field. This field can be repr...原创 2018-04-28 21:00:11 · 132 阅读 · 0 评论