题目
思路:
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define fi first
#define se second
#define lson p << 1
#define rson p << 1 | 1
const int maxn = 1e6 + 5, inf = 1e18 + 5, maxm = 4e4 + 5, mod = 1e9 + 7, N = 1e6;
int a[maxn], b[maxn];
bool vis[maxn];
int n, m;
string s;
int pre[maxn];
int suf[maxn];
void solve(){
int res = 0;
int k;
int x;
int q;
cin >> n;
for(int i = 1; i <= n; i++){
cin >> b[i];
}
for(int i = 1; i <= n; i++){
pre[i] = max(pre[i - 1], b[i] + i);
}
suf[n +