Problem: 2062C - Cirno and Operations
Language: c++23 

Code 1:
#include <bits/stdc++.h>
#define for1(i,a,b) for(int i=(a); (i)<=(b); ++(i))
#define for2(i,a,b) for(int i=(a); (i)>=(b); --(i))
#define pedl cout<<"\n";
#define fi first
#define se second
#define pf push_front
#define pb push_back
#define of pop_front
#define ob pop_back
#define ls p<<1
#define rs p<<1|1
#define lson ls,l,mid
#define rson rs,mid+1,r
using namespace std;
mt19937 rnd(time(0));//uint
mt19937_64 rnd_64(time(0));//ull
template<typename T> void cmin(T& x, T y) {if(x > y) x = y;}
template<typename T> void cmax(T& x, T y) {if(x < y) x = y;}
template<typename T> void rin(T& x){
x=0;bool flag(0);char ch=getchar();while(!isdigit(ch)) flag=ch=='-',ch=getchar();
while(isdigit(ch)){x=(x<<1)+(x<<3)+(ch^48),ch=getchar();}flag?x=-x:0;}
template<typename T> void rout(T x,bool flag=0){
x<0?x=-x,putchar('-'):0;static short S[50],tp(0);do S[++tp]=x%10,x/=10;while(x);
while(tp){putchar(S[tp--]|48);}flag?putchar('\n'):putchar(' ');}
template<typename T> T gcd(T x, T y) {return y?gcd(y,x%y):x;}
template<typename T> T lcm(T x, T y) {return x/gcd(x,y)*y;}
typedef double db;
typedef long double ld;
typedef long long LL;
typedef unsigned long long ULL;
typedef pair<int,int> P;
const double eps = 1e-7;
const int base = 13331;
const int N = 1e5+5;
const int M = 1e5+5;
const int IINF = 0x3f3f3f3f;
const LL LINF = 1e18;
const LL mod = 10007;

LL qpow(LL x,LL y,LL Mod=mod) {
	if(y==0) return 1;
	LL res=(x%=Mod); y--; /*y%=(mod-1);*/
	for(;y;y>>=1,x=x*x%Mod)
		if(y&1) res=res*x%Mod;
	return res;
}
template<typename T>
void madd(T& xx,LL y,LL Mod=mod) {
	LL x=1ll*xx;
	if((x+=y)>0) x%=Mod;
	else x+=((-x)/Mod+1)*Mod;
	xx=x%Mod;
}

LL n;
LL a[N];
LL f[2][N];
LL sum,ans;
void solve(){
	cin>>n; sum=ans=0;
	for1(i,1,n) cin>>a[i],ans+=(f[0][i]=a[i]);
	for1(i,1,n-1){
		for1(j,1,n-i)
			sum+=(f[i%2][j]=f[(i%2)^1][j]-f[(i%2)^1][j+1]);
		cmax(ans,abs(sum));
		sum=0;
	}
	cout<<ans<<"\n";
	return ;
}

signed main(){
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	time_t start=clock();
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
int Testcase=1;
cin>>Testcase;
while(Testcase--){
	solve();
}
	time_t duration=clock()-start;
	cerr<<"\ntime="<<duration;
    return 0;
}

Code 2:
#include <bits/stdc++.h>
#define for1(i,a,b) for(int i=(a); (i)<=(b); ++(i))
#define for2(i,a,b) for(int i=(a); (i)>=(b); --(i))
#define pedl cout<<"\n";
#define fi first
#define se second
#define pf push_front
#define pb push_back
#define of pop_front
#define ob pop_back
#define ls p<<1
#define rs p<<1|1
#define lson ls,l,mid
#define rson rs,mid+1,r
using namespace std;
mt19937 rnd(time(0));//uint
mt19937_64 rnd_64(time(0));//ull
template<typename T> void cmin(T& x, T y) {if(x > y) x = y;}
template<typename T> void cmax(T& x, T y) {if(x < y) x = y;}
template<typename T> void rin(T& x){
x=0;bool flag(0);char ch=getchar();while(!isdigit(ch)) flag=ch=='-',ch=getchar();
while(isdigit(ch)){x=(x<<1)+(x<<3)+(ch^48),ch=getchar();}flag?x=-x:0;}
template<typename T> void rout(T x,bool flag=0){
x<0?x=-x,putchar('-'):0;static short S[50],tp(0);do S[++tp]=x%10,x/=10;while(x);
while(tp){putchar(S[tp--]|48);}flag?putchar('\n'):putchar(' ');}
template<typename T> T gcd(T x, T y) {return y?gcd(y,x%y):x;}
template<typename T> T lcm(T x, T y) {return x/gcd(x,y)*y;}
typedef double db;
typedef long double ld;
typedef long long LL;
typedef unsigned long long ULL;
typedef pair<int,int> P;
const double eps = 1e-7;
const int base = 13331;
const int N = 1e5+5;
const int M = 1e5+5;
const int IINF = 0x3f3f3f3f;
const LL LINF = 1e18;
const LL mod = 10007;

LL qpow(LL x,LL y,LL Mod=mod) {
	if(y==0) return 1;
	LL res=(x%=Mod); y--; /*y%=(mod-1);*/
	for(;y;y>>=1,x=x*x%Mod)
		if(y&1) res=res*x%Mod;
	return res;
}
template<typename T>
void madd(T& xx,LL y,LL Mod=mod) {
	LL x=1ll*xx;
	if((x+=y)>0) x%=Mod;
	else x+=((-x)/Mod+1)*Mod;
	xx=x%Mod;
}

int n;
int a[N];
int f[2][N];
LL sum,ans;
void solve(){
	cin>>n; sum=ans=0;
	for1(i,1,n) cin>>a[i],ans+=(f[0][i]=a[i]);
	for1(i,1,n-1){
		for1(j,1,n-i)
			sum+=(f[i%2][j]=f[(i%2)^1][j]-f[(i%2)^1][j+1]);
		cmax(ans,abs(sum));
		sum=0;
	}
	cout<<ans<<"\n";
	return ;
}

signed main(){
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	time_t start=clock();
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
int Testcase=1;
cin>>Testcase;
while(Testcase--){
	solve();
}
	time_t duration=clock()-start;
	cerr<<"\ntime="<<duration;
    return 0;
}

Answer: 1