三乡网站开发,网站建设留言板怎么做,7k7k传奇世界网页版,小程序源码购买C. Coin Rows#xff1a;题目
题意#xff1a;仿佛是一道难的dp#xff0c;但是因为Alice先走#xff0c;走完bob想要最大化收益。
Alice走完后Bob要么一直往右走#xff0c;要么一开始就下去然后往右走。#include bits/stdc.h
using namespace std;
#define int…C. Coin Rows题目
题意仿佛是一道难的dp但是因为Alice先走走完bob想要最大化收益。
Alice走完后Bob要么一直往右走要么一开始就下去然后往右走。#include bits/stdc.h
using namespace std;
#define int long long
const int N 100010;
int ch[3][N];
int m[3][N],M[3][N];//最大
int zhi[3][N];
signed main()
{int t;cint;while (t--){int n,sum0;cinn;for (int i1;i3;i){for (int j1;jn;j){cinch[i][j];if (i1) sumch[i][j];}}int cou 0x3f3f3f3f;int sum1 0;for (int i1;in;i){sum1ch[2][i-1];sum-ch[1][i];sum max(sum,sum1);cou min(cou,sum);}coutcouendl;}
}