摘要: 题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=11&page=show_problem&problem=1662#include #define ll long longusing namespace std;int n,k,m;ll dp[52][52][52][52][2];void gao(){ dp[1][1][1][1][0]=0,dp[1][1][1][1][1]=1; for(int i=2;i>n>>k> 阅读全文
posted @ 2014-02-09 20:45 wonderzy 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=11&page=show_problem&problem=1558#include #include #include #define ll long longusing namespace std;int t,l;ll dp[65][65];char s[100];ll DP(int x,int y){ if(dp[x][y]!=-1) return dp[x][y]; if(x>y) re 阅读全文
posted @ 2014-02-09 20:43 wonderzy 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=11&page=show_problem&problem=1245#include #include #define ll long longusing namespace std;ll v[300],sum[300];ll dp[300][300];int n;ll DP(int x,int y){ if(dp[x][y]!=(ll)1e17) return dp[x][y]; if(x==y) 阅读全文
posted @ 2014-02-09 20:42 wonderzy 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=11&page=show_problem&problem=531#include #include #define ll long longusing namespace std;int n,t;ll dp[1010][12],a[12][12][33];int c[12][12];int main(){ //freopen("590","r",stdin); 阅读全文
posted @ 2014-02-09 20:41 wonderzy 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=11&page=show_problem&problem=1884#include #include #define mod 1000000using namespace std;int dp[110][110];int DP(int x,int y){ if(dp[x][y]!=-1) return dp[x][y]; if(y==1) return dp[x][y]=1; int ret=0; 阅读全文
posted @ 2014-02-09 20:39 wonderzy 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=11&page=show_problem&problem=652#include #include #include using namespace std;int c[7],sum,sumw;bool in(){ sum=0,sumw=0; for(int i=1;i>c[i],sum+=c[i],sumw+=i*c[i]; for(int i=1;i=0;j--){ for(int... 阅读全文
posted @ 2014-02-09 20:38 wonderzy 阅读(256) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=11&page=show_problem&problem=1010#include #include #include #include #include #include #define maxn 10000using namespace std;void reverse(string &ans,int ct){ for(int i=0;i=0&&d[i]==0) i--; 阅读全文
posted @ 2014-02-09 20:37 wonderzy 阅读(212) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=11&page=show_problem&problem=1022#include #include #include #include #define eps 1e-9using namespace std;int n,k;double dp[110][10];double f(double x){ return x>-eps ? x:(-x);}int main(){ while(cin& 阅读全文
posted @ 2014-02-09 20:35 wonderzy 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=11&page=show_problem&problem=1341注意除以0和溢出的情况#include #include #include using namespace std;int dp[110][64000];int a[110],n,x,k,ans[110];int main(){ int t; cin>>t; while(t--){ cin>>n; for(in 阅读全文
posted @ 2014-02-09 20:33 wonderzy 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=11&page=show_problem&problem=1226#include #include #include using namespace std;string ren;int n,m,t;int a[110][110],dp[110][110];int d[4][2]={-1,0,0,1,1,0,0,-1};int DP(int x,int y,int l){ if(dp[x][y]! 阅读全文
posted @ 2014-02-09 20:30 wonderzy 阅读(128) 评论(0) 推荐(0) 编辑