正文
增加 5 行删除 5 行
33 行未改动343536373839404142434445464748495051525354555657585960616263646566676 行未改动33 行未改动## AC code```cpp#include <bits/stdc++.h>using namespace std;using ll = long long;#define rep(i, a, b) for (int i = a; i <= b; i++)//定义循环#define frep(i, b, a) for (int i = b; i >= a; i--)//定义循环#define s second#define f firstconst int inf = (1 << 30) - 1;const ll INF = 1LL << 60LL;const int mod = 998244353;const int N = 2e5 + 10;int t, n, p, a[N], b[N];//b是maxll c[N];//c是psuminline void solve() {cin >> n;rep(i, 1, n) cin >> a[i];rep(i, 1, n) {b[i] = max(b[i - 1], a[i]);//前缀最大值c[i] = c[i - 1] + a[i];//前缀和}rep(i, 1, n) cout << b[n - i + 1] + c[n] - c[n - i + 1] << ' ';//输出答案}int main() {ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);cin >> t;6 行未改动33 行未改动343536373839404142434445464748495051525354555657585960616263646566676 行未改动33 行未改动## AC code```cpp#include <bits/stdc++.h>using namespace std;using ll = long long;#define rep(i, a, b) for (int i = a; i <= b; i++)//定义循环#define frep(i, b, a) for (int i = b; i >= a; i--)//定义循环#define s second#define f firstconst int inf = (1 << 30) - 1;const ll INF = 1LL << 60LL;const int mod = 998244353;const int N = 2e5 + 10;int t, n, p, a[N], b[N];//b是maxll c[N];//c是psuminline void solve() {cin >> n;rep(i, 1, n) cin >> a[i];rep(i, 1, n) {b[i] = max(b[i - 1], a[i]);//前缀最大值c[i] = c[i - 1] + a[i];//前缀和}rep(i, 1, n) cout << b[n - i + 1] + c[n] - c[n - i + 1] << ' ';//输出答案}int main() {ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);cin >> t;6 行未改动