D. Yet Another Yet Another Task
题目大意
给你一个长度为n的序列,你要从中选着任意一段连续的区间,然后用区间和减去这个区间最大值,问你可以的到的值最大是多少。
解题思路
由于n个数的值都很小,不超过30,我们可以发现,如果连续的去掉一个最大值以后,所有的数肯定不会超过这个数,所以可以枚举最大值就可以了
代码
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int mx=100100;
const ll mod=998244353;
int a[mx];
ll poow(ll a,ll b){
ll res=1;
while(b