dp[i][j]:用A的前i的字符和B的前j个字符能否组成i+j长度的合法C串 O(n^2)的方法有点糟糕 /*H E A D*/ char str1[maxn],str2[maxn],str3[maxn]; int dp[1003][1003]; int main(){ int T=read(),kase=0; while(T--){ s1(str1);s1(str2);s1(str3); memset(dp,0,sizeof dp); dp[0][0]=1; dp[1][0]=(str1[1…
Super Jumping! Jumping! Jumping! Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 33384 Accepted Submission(s): 15093 Problem Description Nowadays, a kind of chess game called “Super Jumping!…
Problem H. ICPC QuestTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100500/attachments Description Noura Boubou is a Syrian volunteer at ACM ACPC (Arab Collegiate Programming Contest) since 2011. She graduated from Tishreen Un…
J - 简单dp Crawling in process... Crawling failed Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit Status Description It is a little known fact that cows love apples. Farmer John has two apple trees (which are conveni…
I - 简单dp 例题扩展 Crawling in process... Crawling failed Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Description Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HD…
题意:给你n种花,m个盆,花盆是有顺序的,每种花只能插一个花盘i,下一种花的只能插i<j的花盘,现在给出价值,求最大价值 简单dp #include <iostream> #include<cstdio> #include<cstring> using namespace std; #define N 110 int dp[N][N],a[N][N]; int main(int argc, char** argv) { int n,m,i,j; while(sca…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2571 简单dp, dp[n][m] +=( dp[n-1][m],dp[n][m-1],d[i][k] ) k 为m的因子 PS:0边界要初始为负数(例如-123456789)越大越好 代码: #include <stdio.h> #include <string.h> int dp[25][1005]; #define max(x,y) x > y ? x : y int m…