hdu 2128 Frog(简单DP)】的更多相关文章

Frog Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 712    Accepted Submission(s): 338 Problem Description A little frog named Fog is on his way home. The path's length is N (1 <= N <= 100),…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4576 题意:给出1~n的环,m个操作,每次能顺时针或逆时针走w步,询问最后在l~r这段区间内概率.(1<=n<=200) ,(0<=m<=1,000,000),(1<=l<=r<=n).分析:每次从某一个数字到达另外数字的概率为0.5,按概率dp求出到达每个数字的概率,然后枚举从l到r的概率相加即可.dp[i][j]表示第i次操作落在数字j上的概率,但是不能直接开10…
哎,注意细节啊,,,,,,,思维的严密性..... 11699193 2014-09-22 08:46:42 Accepted 5037 796MS 1864K 2204 B G++ czy Frog Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others) Total Submission(s): 454    Accepted Submission(s): 96 Problem…
题意:给你一个序列,问相邻两数高度差绝对值小于等于H的子序列有多少个. dp[i]表示以i为结尾的子序列有多少,易知状态转移方程为:dp[i] = sum( dp[j] ) + 1;( abs( height[i] - height[j] ) <= H ) 由abs( height[i] - height[j] ) <= H 可得 height[i] - H <= height[j] <= height[i] + H 将序列中的数离散化,每个height对应一个id, 用树状数组求…
Problem Description Given a matrix with n rows and m columns ( n+m ,) and you want to go to the number at bottom-right corner (n,m). And you must go right or go down every steps. Let the numbers you go through become an array a1,a2,...,a2k. The cost…
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!…
题目链接: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…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5375 题面: Gray code Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 626    Accepted Submission(s): 369 Problem Description The reflected binary cod…
题目 简单dp //简单的dp #include<stdio.h> #include<string.h> #include<algorithm> using namespace std; ][];//dp[i][j] di i ceng di j ge zui da he ][]; int main() { int t; scanf("%d",&t); while(t--) { int n; scanf("%d",&…
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…