思路很简单。。
就是以行数为阶段
每行左右端点,和上一行左右端点,以及这一行是递增还是递减为状态。
6维线性DP
但是比较麻烦。。
我判断条件卡了2个多小时 心态炸了。。。感觉在过程种枚举比写条件更稳一点
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//typedef __int128 LL;
//typedef unsigned long long ull;
//#define F first
//#define S second
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;
const ld PI=acos(-1);
const ld eps=1e-9;
//unordered_map<int,int>mp;
#define ls (o<<1)
#define rs (o<<1|1)
#define pb push_back
const int seed=131;
const int M = 1e5+7;
int a[16][16];
struct node
{
int i,j,l,r,x,y;
}pre[16][227][16][16][2][2];
int f[16][227][16][16][2][2];//f ijkq 处理到第i行,左边坐标j,左边是否递减过,右边k,右边是否递减过,用了q个格子的最大权值和
void print(node s)
{
// cout<<s.i<<" "<<s.j<<" "