Problem: 2062C - Cirno and Operations
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template<class T> using pbds= tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define int long long
#define endl '\n'
#define vi vector<int>
#define eb emplace_back
#define pb push_back
#define all(a) a.begin(),a.end()
#define f(i,a,b) for(int i=a; i<b; i++)
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)


#ifndef ONLINE_JUDGE
#define debug(x) cerr << #x <<" "; _print(x); cerr << endl;
#else
#define debug(x)
#endif
void _print(int t) {cerr << t;}
void _print(long double t) {cerr << t;}
void _print(string t) {cerr << t;}
void _print(char t) {cerr << t;}
void _print(double t) {cerr << t;}
template <class T, class V> void _print(pair <T, V> p) {cerr << "{"; _print(p.first); cerr << ","; _print(p.second); cerr << "}";}
template <class T> void _print(vector <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";}
template <class T> void _print(set <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";}
template <class T> void _print(multiset <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";}
template <class T, class V> void _print(map <T, V> v) {cerr << "[ "; for (auto i : v) {_print(i); cerr << " ";} cerr << "]";}


int isprime(int n)
{
    int a = sqrt(n);
    int i;
    for (i = 2; i <= a; i++){
        if (n % i == 0){
            return 0;
        }
    }
    if (i == a + 1){
        return 1;
    }
    return 0;
}


main()
{
    IOS;

    int t; cin>>t;
    while(t--){
        int n;
        cin >> n;
        vector<int> a(n);
        for (int i = 0; i < n; i++) {
            cin >> a[i];
        }
        int ans = accumulate(a.begin(), a.end(), 0);
        while (a.size() > 1) {
            vector<int> b(a.size() - 1);
            for (int i = 0; i < a.size() - 1; i++) {
                b[i] = a[i + 1] - a[i];
            }
            swap(a, b);
            ans = max(ans, (int)abs(accumulate(a.begin(), a.end(), 0)));
        }
        cout << ans << endl;

    }
}

Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template<class T> using pbds= tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define int long long
#define endl '\n'
#define vi vector<int>
#define eb emplace_back
#define pb push_back
#define all(a) a.begin(),a.end()
#define f(i,a,b) for(int i=a; i<b; i++)
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)


#ifndef ONLINE_JUDGE
#define debug(x) cerr << #x <<" "; _print(x); cerr << endl;
#else
#define debug(x)
#endif
void _print(int t) {cerr << t;}
void _print(long double t) {cerr << t;}
void _print(string t) {cerr << t;}
void _print(char t) {cerr << t;}
void _print(double t) {cerr << t;}
template <class T, class V> void _print(pair <T, V> p) {cerr << "{"; _print(p.first); cerr << ","; _print(p.second); cerr << "}";}
template <class T> void _print(vector <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";}
template <class T> void _print(set <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";}
template <class T> void _print(multiset <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";}
template <class T, class V> void _print(map <T, V> v) {cerr << "[ "; for (auto i : v) {_print(i); cerr << " ";} cerr << "]";}


int isprime(int n)
{
    int a = sqrt(n);
    int i;
    for (i = 2; i <= a; i++){
        if (n % i == 0){
            return 0;
        }
    }
    if (i == a + 1){
        return 1;
    }
    return 0;
}


main()
{
    IOS;

    int t; cin>>t;
    while(t--){
        int n;
        cin >> n;
        vector<int> a(n);
        for (int i = 0; i < n; i++) {
            cin >> a[i];
        }
        long long ans = accumulate(a.begin(), a.end(), 0);
        while (a.size() > 1) {
            vector<int> b(a.size() - 1);
            for (int i = 0; i < a.size() - 1; i++) {
                b[i] = a[i + 1] - a[i];
            }
            swap(a, b);
            ans = max(ans, (long long)abs(accumulate(a.begin(), a.end(), 0)));
        }
        cout << ans << endl;

    }
}