摘要:
题目链接:http://poj.org/problem?id=2096#include#include#include#includeusing namespace std;const int maxn = 1005;const int INF = 0x3f3f3f3f;double dp[maxn][maxn];int main(){ int n,s; cin>>n>>s; for(int i=n;i>=0;i--) for(int j=s;j>=0;j--) if(i == n && j == s) dp[n][s] = 0,dp[n+1 阅读全文
摘要:
题目链接:http://poj.org/problem?id=1080#include#include#include#includeusing namespace std;const int maxn = 105;const int INF = 0x3f3f3f;int dp[maxn][maxn];int A[maxn],B[maxn];int mymap[6][6] = { {0, 0, 0, 0, 0, 0}, {0,5,-1,-2,-1,-3 }, {0,-1,5,-3,-2,-4 ... 阅读全文
摘要:
题目链接:http://poj.org/problem?id=2479#include#include#include#includeusing namespace std;const int maxn = 50005;const int INF = 0x3f3f3f3f;int dp1[maxn];int dp2[maxn];int a[maxn];int N;int main(){ int T; cin>>T; while(T--){ scanf("%d",&N); for(int i=1;i=1;i--){ dp2[i]... 阅读全文