Problem: 2062C - Cirno and Operations
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

// #define en endl
#define endl '\n'
#define ll long long
#define all(v) v.begin(), v.end()
#define gofast ios_base::sync_with_stdio(false), cin.tie(nullptr);
// Overloading
istream &operator>>(istream &input, vector<double> &v)
{
    for (auto &it : v)
        input >> it;
    return input;
}
//-------------------------------------------------
// --------------- important functions ---------

int n, m, xv;
int xd[]{1, -1, 0, 0, 1, -1, 1, -1}, yd[]{0, 0, 1, -1, 1, 1, -1, -1};
const int N = 1e5, mod = 1e9 + 7, inf = 0x3f3f3f3f;
const ll llinf = 0x3f3f3f3f3f3f3f3f;
bool checkValidation(int x, int y)
{
    return x >= 0 && x < n && y >= 0 && y < m;
}
bool checktwovalues(int x, int y)
{
    return ((x < 0 && y > 0) || (x > 0 && y < 0));
}
void solve()
{
    int n;
    cin >> n;
    vector<ll> v(n);
    for (auto &it : v)
        cin >> it;
    ll ans = -1 * llinf;
    ll sum = 0;
    for (auto it : v)
    {
        sum += it;
    }
    ans = ((v.size() != 1) ? max(sum, -1 * sum) : sum);
    while (v.size() > 1)
    {
        sum = 0;
        vector<ll> temp;
        for (int i = 1; i < v.size(); i++)
        {
            temp.push_back(v[i] - v[i - 1]);
        }
        for (auto it : temp)
            sum += it;
        ans = max(ans, max(sum, -1 * sum));
        v = temp;
    }
    if (ans == -1 * llinf)
    {
        cout << v[0] << endl;
    }
    else
    {
        cout << ans << endl;
    }
}

int main()
{
    gofast
        // cout << fixed << setprecision(10);
        int T = 1;
    cin >> T;
    // seive();
    // build();
    while (T--)
    {
        solve();
    }
    return 0;
}

Submission (verdict: Accepted):
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

// #define en endl
#define endl '\n'
#define ll long long
#define all(v) v.begin(), v.end()
#define gofast ios_base::sync_with_stdio(false), cin.tie(nullptr);
// Overloading
istream &operator>>(istream &input, vector<double> &v)
{
    for (auto &it : v)
        input >> it;
    return input;
}
//-------------------------------------------------
// --------------- important functions ---------

int n, m, xv;
int xd[]{1, -1, 0, 0, 1, -1, 1, -1}, yd[]{0, 0, 1, -1, 1, 1, -1, -1};
const int N = 1e5, mod = 1e9 + 7, inf = 0x3f3f3f3f;
const ll llinf = 0x3f3f3f3f3f3f3f3f;
bool checkValidation(int x, int y)
{
    return x >= 0 && x < n && y >= 0 && y < m;
}
bool checktwovalues(int x, int y)
{
    return ((x < 0 && y > 0) || (x > 0 && y < 0));
}
void solve()
{
    int n;
    cin >> n;
    vector<ll> v(n);
    for (auto &it : v)
        cin >> it;
    ll ans = -1 * llinf;
    ll sum = 0;
    for (auto it : v)
    {
        sum += it;
    }
    ans = max(ans, sum);
    while (v.size() > 1)
    {
        sum = 0;
        vector<ll> temp;
        for (int i = 1; i < v.size(); i++)
        {
            temp.push_back(v[i] - v[i - 1]);
        }
        for (auto it : temp)
            sum += it;
        ans = max(ans, max(sum, -1 * sum));
        v = temp;
    }
    if (ans == -1 * llinf)
    {
        cout << v[0] << endl;
    }
    else
    {
        cout << ans << endl;
    }
}

int main()
{
    gofast
        // cout << fixed << setprecision(10);
        int T = 1;
    cin >> T;
    // seive();
    // build();
    while (T--)
    {
        solve();
    }
    return 0;
}