蜜汁WA~~~

P1005 [NOIP2007 提高组] 矩阵取数游戏

我是来~~打酱油~~水的 ![](https://cdn.luogu.com.cn/upload/pic/8114.png)
by 冰の妖精 @ 2017-09-20 22:41:13


e ,似乎是高精度有问题。。。。woc
by h__a_ny @ 2017-09-23 14:21:55


#。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。 ```cpp #include<bits/stdc++.h> #define lll __int128 void print(lll x) { if (x==0) return; if (x) print(x/10); putchar(x%10+'0'); } int n,m; lll ans=0; int a[100]={0}; lll f[100][100]; lll p[100]={1}; lll dp() { memset(f,0,sizeof(f)); for(int i=1;i<=m;i++) { for(int j=m;j>=i;j--) { f[i][j]=std::max( f[i-1][j]+ p[m-j+i-1]*a[i-1] , f[i][j+1]+ p[m-j+i-1]*a[j+1] ); } } lll maxn=-1; for(int i=1;i<=m;i++) maxn=std::max(maxn,f[i][i]+a[i]*p[m]); return maxn; } int main() { for(int i=1;i<=90;i++) p[i]=p[i-1]<<1; scanf("%d%d",&n,&m); for(int i=1;i<=n;i++) { for(int j=1;j<=m;j++) scanf("%d",a+j); ans+=dp(); } if(ans==0) puts("0"); else print(ans); return 0; } ```
by lty2017 @ 2017-10-11 23:07:22


@[韩一](/space/show?uid=8263) puyi太劲辣,为puyi打call!!!
by lizongru @ 2017-10-26 18:11:54


![](https://cdn.luogu.com.cn/upload/pic/9737.png)
by 我很辣ji看签名 @ 2017-10-31 22:34:13


![](https://cdn.luogu.com.cn/upload/pic/8114.png) ![](https://cdn.luogu.com.cn/upload/pic/8114.png) ![](https://cdn.luogu.com.cn/upload/pic/8114.png) ![](https://cdn.luogu.com.cn/upload/pic/8114.png) ![](https://cdn.luogu.com.cn/upload/pic/8114.png) ![](https://cdn.luogu.com.cn/upload/pic/8114.png) ![](https://cdn.luogu.com.cn/upload/pic/8114.png) ![](https://cdn.luogu.com.cn/upload/pic/8114.png) ![](https://cdn.luogu.com.cn/upload/pic/8114.png) ![](https://cdn.luogu.com.cn/upload/pic/8114.png) ![](https://cdn.luogu.com.cn/upload/pic/8114.png) ![](https://cdn.luogu.com.cn/upload/pic/8114.png) ![](https://cdn.luogu.com.cn/upload/pic/8114.png) ![](https://cdn.luogu.com.cn/upload/pic/8114.png) ![](https://cdn.luogu.com.cn/upload/pic/8114.png) ![](https://cdn.luogu.com.cn/upload/pic/8114.png) ![](https://cdn.luogu.com.cn/upload/pic/8114.png) ![](https://cdn.luogu.com.cn/upload/pic/8114.png) ![](https://cdn.luogu.com.cn/upload/pic/8114.png) ![](https://cdn.luogu.com.cn/upload/pic/8114.png) ![](https://cdn.luogu.com.cn/upload/pic/8114.png) ![](https://cdn.luogu.com.cn/upload/pic/8114.png) ![](https://cdn.luogu.com.cn/upload/pic/8114.png) ![](https://cdn.luogu.com.cn/upload/pic/8114.png) ![](https://cdn.luogu.com.cn/upload/pic/8114.png) ![](https://cdn.luogu.com.cn/upload/pic/8114.png) ![](https://cdn.luogu.com.cn/upload/pic/8114.png) ![](https://cdn.luogu.com.cn/upload/pic/8114.png) ![](https://cdn.luogu.com.cn/upload/pic/8114.png) ![](https://cdn.luogu.com.cn/upload/pic/8114.png) ![](https://cdn.luogu.com.cn/upload/pic/8114.png) ![](https://cdn.luogu.com.cn/upload/pic/8114.png) ![](https://cdn.luogu.com.cn/upload/pic/8114.png) ![](https://cdn.luogu.com.cn/upload/pic/8114.png)
by 我很辣ji看签名 @ 2017-10-31 22:34:47


|