ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2062C - Cirno and Operations
Language: C++17 (GCC 7-32)


Submission (verdict: Time limit exceeded on test 2):
#include <bits/stdc++.h>
using namespace std;

#define ll long long

ll ret;
void bck(vector <int> ls, bool rev)
{
	ll act = 0;
	for(auto u : ls) act += u;
	ret = max(ret, act);

	if((int)ls.size() == 1) return;
	vector <int> tmp;
	for(int i=1; i<(int)ls.size(); i++)
		tmp.push_back(ls[i]-ls[i-1]);
	bck(tmp,0);

	if(!rev)
	{
		reverse(ls.begin(), ls.end());
		bck(ls,1);
	}
}

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);

	int t; cin >> t;
	while(t--)
	{
		int n; cin >> n; vector <int> ls;
		for(int i=0; i<n; i++)
		{
			int a; cin >> a;
			ls.push_back(a);
		}
		ret = -1e9; bck(ls,0);
		cout << ret << '\n';
	}
}
Problem: 2062C - Cirno and Operations
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
using namespace std;

#define ll long long

int n;
ll ret;
void bck(vector <int> ls, bool rev)
{
	ll act = 0;
	for(auto u : ls) act += u;
	ret = max(ret, act);
	
	if((int)ls.size() <= n-8) return;
	if((int)ls.size() == 1) return;
	vector <int> tmp;
	for(int i=1; i<(int)ls.size(); i++)
		tmp.push_back(ls[i]-ls[i-1]);
	bck(tmp,0);

	if(!rev)
	{
		reverse(ls.begin(), ls.end());
		bck(ls,1);
	}
}

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);

	int t; cin >> t;
	while(t--)
	{
		cin >> n; vector <int> ls;
		for(int i=0; i<n; i++)
		{
			int a; cin >> a;
			ls.push_back(a);
		}
		ret = -1e9; bck(ls,0);
		cout << ret << '\n';
	}
}

Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;

#define ll long long

map <vector<int>, bool> vis;
int n;
ll ret;
void bck(vector <int> ls, bool rev)
{
	if(vis[ls]) return;
	vis[ls] = 1;
	ll act = 0;
	for(auto u : ls) act += u;
	ret = max(ret, act);

	if((int)ls.size() == 1) return;
	vector <int> tmp;
	for(int i=1; i<(int)ls.size(); i++)
		tmp.push_back(ls[i]-ls[i-1]);
	bck(tmp,0);

	if(!rev)
	{
		reverse(ls.begin(), ls.end());
		bck(ls,1);
	}
}

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);

	int t; cin >> t;
	while(t--)
	{
		cin >> n; vector <int> ls;
		for(int i=0; i<n; i++)
		{
			int a; cin >> a;
			ls.push_back(a);
		}
		vis.clear();
		ret = -1e9; bck(ls,0);
		cout << ret << '\n';
	}
}
Problem: 2050E - Three Strings
Language: PyPy 3-64

Previous submission (verdict: Wrong answer on test 1):
def solve():
    import sys
    input = sys.stdin.read
    data = input().split()
    
    t = int(data[0])  # Количество тестов
    index = 1  # Индекс для чтения данных
    
    results = []
    
    for _ in range(t):
        a = data[index]
        b = data[index + 1]
        res = data[index + 2]
        index += 3
        
        n, m = len(a), len(b)
        inf = 10**9

        # Инициализация dp массива
        dp = [[inf] * (m + 1) for _ in range(n + 1)]
        dp[0][0] = 0

        # Заполнение dp для первого столбца
        for i in range(1, n + 1):
            dp[i][0] = dp[i - 1][0] + (a[i - 1] != res[i - 1])

        # Заполнение dp для первой строки
        for j in range(1, m + 1):
            dp[0][j] = dp[0][j - 1] + (b[j - 1] != res[j - 1])

        # Основное заполнение dp
        for i in range(1, n + 1):
            for j in range(1, m + 1):
                dp[i][j] = min(
                    dp[i - 1][j] + (a[i - 1] != res[i + j - 1]),
                    dp[i][j - 1] + (b[j - 1] != res[i + j - 1])
                )

        # Добавляем результат для текущего теста
        results.append(dp[n][m])

    # Вывод всех результатов
    for result in results:
        print(result)


Submission (verdict: Accepted):
for _ in range(int(input())):
    a = input()
    b = input()
    c = input()
    n, m = len(a), len(b)
    inf = float('inf')
    dp = [[inf] * (m + 1) for _ in range(n + 1)]
    dp[0][0] = 0
    for i in range(1, n + 1):
        dp[i][0] = dp[i - 1][0] + (a[i - 1] != c[i - 1])

    for j in range(1, m + 1):
        dp[0][j] = dp[0][j - 1] + (b[j - 1] != c[j - 1])

    for i in range(1, n + 1):
        for j in range(1, m + 1):
            dp[i][j] = min(dp[i - 1][j] + (a[i - 1] != c[i + j - 1]),
                           dp[i][j - 1] + (b[j - 1] != c[i + j - 1]))
    print(dp[n][m])
Problem: 2050E - Three Strings
Language: PyPy 3-64

Previous submission (verdict: Wrong answer on test 1):
for _ in range(int(input())):
    a = input()
    b = input()
    c = input()
    dp = []
    l_a = len(a)
    l_b = len(b)
    for i in range(l_a):
        dp.append([0] * l_b)
    for i in range(l_a):
        for j in range(l_b):
            min(dp[i - 1][j] + (a[i - 1] != c[i + j - 1]), 
                dp[i][j - 1] + (b[j - 1] != c[i + j - 1]))
    print(dp[-1][-1])

Submission (verdict: Wrong answer on test 1):
def solve():
    import sys
    input = sys.stdin.read
    data = input().split()
    
    t = int(data[0])  # Количество тестов
    index = 1  # Индекс для чтения данных
    
    results = []
    
    for _ in range(t):
        a = data[index]
        b = data[index + 1]
        res = data[index + 2]
        index += 3
        
        n, m = len(a), len(b)
        inf = 10**9

        # Инициализация dp массива
        dp = [[inf] * (m + 1) for _ in range(n + 1)]
        dp[0][0] = 0

        # Заполнение dp для первого столбца
        for i in range(1, n + 1):
            dp[i][0] = dp[i - 1][0] + (a[i - 1] != res[i - 1])

        # Заполнение dp для первой строки
        for j in range(1, m + 1):
            dp[0][j] = dp[0][j - 1] + (b[j - 1] != res[j - 1])

        # Основное заполнение dp
        for i in range(1, n + 1):
            for j in range(1, m + 1):
                dp[i][j] = min(
                    dp[i - 1][j] + (a[i - 1] != res[i + j - 1]),
                    dp[i][j - 1] + (b[j - 1] != res[i + j - 1])
                )

        # Добавляем результат для текущего теста
        results.append(dp[n][m])

    # Вывод всех результатов
    for result in results:
        print(result)
Problem: 2050E - Three Strings
Language: PyPy 3-64


Submission (verdict: Wrong answer on test 1):
for _ in range(int(input())):
    a = input()
    b = input()
    c = input()
    dp = []
    l_a = len(a)
    l_b = len(b)
    for i in range(l_a):
        dp.append([0] * l_b)
    for i in range(l_a):
        for j in range(l_b):
            min(dp[i - 1][j] + (a[i - 1] != c[i + j - 1]), 
                dp[i][j - 1] + (b[j - 1] != c[i + j - 1]))
    print(dp[-1][-1])
Problem: 2061D - Kevin and Numbers
Language: Java 21


Submission (verdict: Wrong answer on test 3):
import java.util.*;
import java.lang.*;
import java.io.*;
public class Codechef
    {
	static FastScanner fs = null;
	public static void main(String[] args) {
		fs = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		int t = fs.nextInt();
        while(t-->0){
            int n = fs.nextInt();
            int m = fs.nextInt();
            long ar[] = new long[n];
            long br[] = new long[m];
            long sum = (long)0;
            PriorityQueue<Long> pq1 = new PriorityQueue<>();
            PriorityQueue<Long> pq2 = new PriorityQueue<>();
            for(int i = 0;i<n;i++){
                ar[i] =  fs.nextLong();
                sum+=ar[i];
                pq1.add(ar[i]);
            }
            for(int j = 0;j<m;j++){
                br[j] = fs.nextLong();
                sum-=br[j];
                pq2.add(br[j]);
            }
            //Arrays.sort(ar);
            //Arrays.sort(br);
            boolean res = true;
            if(sum==(long)0){
                while(!pq1.isEmpty() && !pq2.isEmpty()){
                    long n1 = pq1.remove();
                    long n2 = pq2.remove();
                    //out.println(n1+" --- "+n2);
                    if(n1==n2){
                        
                    }
                    else{
                        if(pq1.isEmpty()){
                            res = false;
                            break;
                        }
                        long n3 = pq1.remove();
                        if((n3-n1)>1){
                            res = false;
                            break;
                        }
                        pq2.add(n2);
                        pq1.add((n1+n3));
                    }
                }
            }
            else{
                res = false;
            }
            if(res)
            out.println("YES");
            else
            out.println("NO");
        }
		out.close();
	}
	static void sort(int[] a) {
		ArrayList<Integer> l=new ArrayList<>();
		for (int i:a) l.add(i);
		Collections.sort(l);
		for (int i=0; i<a.length; i++) a[i]=l.get(i);
	}
	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}
		
		int nextInt() {
			return Integer.parseInt(next());
		}
		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
		long nextLong() {
			return Long.parseLong(next());
		}
		double nextDouble() {
			return Double.parseDouble(next());
		}
	}
}
Problem: 2052A - Adrenaline Rush
Language: C++20 (GCC 13-64)


Submission (verdict: Wrong answer on test 1):
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define fill(v) for(auto& i: v) cin>>i;
#define acc(v) sort(v.begin(), v.end())
#define dec(v) sort(v.rbegin(), v.rend())
#define has(c, x) {return c.find(x)!=c.end();}
#define pr(v) for(auto i: v) cout<<i<<" "; cout<<endl;
#define pb(r) push_back(r)
#define pr1(v, i) for(auto j: v) cout<<j[i]<<" "; cout<<endl; 
#define del(s, x) if(s.find(x)!=s.end()) s.erase(s.find(x)) 
#define no {cout<<"no"<<endl; return;}
#define show(x) cout<<#x<<": "<<x<<" ";
#define _init_(v) iota(v.begin(), v.end(), 0);
#define rev(v) reverse(v.begin(), v.end())
#define vll vector<ll>
#define vvll vector<vll>
#define vvvll vector<vvll>
#define vd vector<double>
#define GCD(a, b) __gcd<long long>(a, b)
#define yes {cout<<"yes"<<endl; return;}
// const ll MOD1=998244353;
// const ll MOD2=1e9+7;
const ll MOD=1e9+7;
ll MAX=1e16;
void solve(){
    ll n; cin>>n;
    vll fin_res(n); fill(fin_res); for(auto& i: fin_res)i--;
    //fin_res is final result where ith position has vehicle i
    vll curr_car(n); for(int i=0; i<n; i++)curr_car[i]=i;
    //curr_car contains the car at position i
    vll car_pos=curr_car;
    //car contains the position of car i
    vvll res;

    for(int i=0;i<n;i++){
        int curr_position=car_pos[fin_res[i]];
        int next_position=curr_position+1;
        int now_car=curr_car[curr_position];
        if(next_position<n){
            int next_car=curr_car[next_position];
            res.push_back({next_car, now_car});
            res.push_back({now_car, next_car});
        }
        for(int j=curr_position-1; j>=i; j--){
            int prev_car=curr_car[j];
            res.push_back({now_car, prev_car});
            int prev_position=j, curr_position=j+1;
            swap(curr_car[prev_position], curr_car[curr_position]);
            car_pos[now_car]=j; car_pos[prev_car]=j+1;
        }
    } 
    cout<<res.size()<<endl;
    for(auto i: res){
        cout<<i[0]<<" "<<i[1]<<endl;
    }
}

int main(){
    int t=1;
    // cin>>t;
    while(t--) solve();
}
Problem: 2052A - Adrenaline Rush
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 4):
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<ll,ll>;
const int N = 2e5+1;
ll a[N],b[N];
int main() {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    ll n;
    cin>>n;
    vector<pll> ans(0);
    for(int i = 1;i<=n;++i){
    	cin>>a[i];
    	b[i] = i;
	}
	for(int i = n;i>=1;--i){
		bool ok = false;
		for(int j = 1;j<=i;++j){
			if(b[j]==a[i]){
				ok = true;
			}
			else if(ok){
				ans.push_back({b[j],b[j-1]});
				swap(b[j-1],b[j]);
			}
		}
	}
	for(int i = 1;i<=n-1;++i){
		if(a[i]+1==a[i+1]){
			ans.push_back({a[i+1],a[i]});
			ans.push_back({a[i],a[i+1]});
		}
	}
	cout<<ans.size()<<endl;
	for(auto i:ans){
		cout<<i.first<<' '<<i.second<<endl;
	}
    return 0;
}


Submission (verdict: Wrong answer on test 4):
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<ll,ll>;
const int N = 2e5+1;
ll a[N],b[N];
int main() {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    ll n;
    cin>>n;
    vector<pll> ans(0);
    for(int i = 1;i<=n;++i){
    	cin>>a[i];
    	b[i] = i;
	}
	ll len = 1,pos = 0;
	for(int i = 1;i<=n;++i){
		ll tmp = 1;
		ll cur = a[i]+1;
		for(int j = i+1;j<=n;++j){
			//cout<<'*'<<tmp<<' '<<cur<<' '<<a[j]<<endl;
			if(a[j]==cur){
				tmp++;
				cur++;
			}
		}
		if(len<tmp){
					len = tmp;
					pos = a[i];
			}
	}
	//cout<<len<<' '<<pos<<endl;
	if(pos!=0){
	for(int i = pos;i<=pos+len-2;++i){
		ans.push_back({i+1,i});
		ans.push_back({i,i+1});
	}	
	}
	
	for(int i = n;i>=1;--i){
		bool ok = false;
		for(int j = 1;j<=i;++j){
			if(b[j]==a[i]){
				ok = true;
			}
			else if(ok){
				ans.push_back({b[j],b[j-1]});
				swap(b[j-1],b[j]);
			}
		}
	}
	cout<<ans.size()<<endl;
	for(auto i:ans){
		cout<<i.first<<' '<<i.second<<endl;
	}
    return 0;
}
Problem: 2052A - Adrenaline Rush
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 4):
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<ll,ll>;
const int N = 2e5+1;
ll a[N],b[N];
int main() {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    ll n;
    cin>>n;
    vector<pll> ans(0);
    for(int i = 1;i<=n;++i){
    	cin>>a[i];
    	b[i] = i;
	}
	ll len = 1,pos = 0;
	for(int i = 1;i<=n;++i){
		ll tmp = 1;
		ll cur = a[i]+1;
		for(int j = i+1;j<=n;++j){
			//cout<<'*'<<tmp<<' '<<cur<<' '<<a[j]<<endl;
			if(a[j]==cur){
				tmp++;
				cur++;
			}
		}
		if(len<tmp){
					len = tmp;
					pos = a[i];
			}
	}
	//cout<<len<<' '<<pos<<endl;
	if(pos!=0){
	for(int i = pos;i<=pos+len-2;++i){
		ans.push_back({i+1,i});
		ans.push_back({i,i+1});
	}	
	}
	
	for(int i = n;i>=1;--i){
		bool ok = false;
		for(int j = 1;j<=i;++j){
			if(b[j]==a[i]){
				ok = true;
			}
			else if(ok){
				ans.push_back({b[j],b[j-1]});
				swap(b[j-1],b[j]);
			}
		}
	}
	cout<<ans.size()<<endl;
	for(auto i:ans){
		cout<<i.first<<' '<<i.second<<endl;
	}
    return 0;
}


Submission (verdict: Wrong answer on test 4):
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<ll,ll>;
const int N = 1001;
ll a[N],b[N];
bool vis[N];
int main() {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    ll n;
    cin>>n;
    vector<pll> ans(0);
    for(int i = 1;i<=n;++i){
    	cin>>a[i];
    	b[i] = i;
	}
	memset(vis,0,sizeof(vis));
	for(int i = 1;i<=n;++i){
		if(!vis[i]){
			vis[i] = true;
			ll cur = a[i]+1;
			for(int j = i;j<=n;++j){
				if(a[j]==cur){
					vis[j] = true;
					ans.push_back({cur,cur-1});
					ans.push_back({cur-1,cur});
					cur++;
				}
			}
		}
	}
	for(int i = n;i>=1;--i){
		bool ok = false;
		for(int j = 1;j<=i;++j){
			if(b[j]==a[i]){
				ok = true;
			}
			else if(ok){
				ans.push_back({b[j],b[j-1]});
				swap(b[j-1],b[j]);
			}
		}
	}
	cout<<ans.size()<<endl;
	for(auto i:ans){
		cout<<i.first<<' '<<i.second<<endl;
	}
    return 0;
}
Problem: 2052A - Adrenaline Rush
Language: C++20 (GCC 13-64)


Submission (verdict: Wrong answer on test 4):
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<ll,ll>;
const int N = 2e5+1;
ll a[N],b[N];
int main() {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    ll n;
    cin>>n;
    vector<pll> ans(0);
    for(int i = 1;i<=n;++i){
    	cin>>a[i];
    	b[i] = i;
	}
	for(int i = n;i>=1;--i){
		bool ok = false;
		for(int j = 1;j<=i;++j){
			if(b[j]==a[i]){
				ok = true;
			}
			else if(ok){
				ans.push_back({b[j],b[j-1]});
				swap(b[j-1],b[j]);
			}
		}
	}
	for(int i = 1;i<=n-1;++i){
		if(a[i]+1==a[i+1]){
			ans.push_back({a[i+1],a[i]});
			ans.push_back({a[i],a[i+1]});
		}
	}
	cout<<ans.size()<<endl;
	for(auto i:ans){
		cout<<i.first<<' '<<i.second<<endl;
	}
    return 0;
}
Problem: 2052A - Adrenaline Rush
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 4):
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<ll,ll>;
const int N = 1001;
ll a[N],b[N];
bool vis[N];
int main() {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    ll n;
    cin>>n;
    vector<pll> ans(0);
    for(int i = 1;i<=n;++i){
    	cin>>a[i];
    	b[i] = i;
	}
	memset(vis,0,sizeof(vis));
	for(int i = 1;i<=n;++i){
		if(!vis[i]){
			vis[i] = true;
			ll cur = a[i]+1;
			for(int j = i;j<=n;++j){
				if(a[j]==cur){
					vis[j] = true;
					ans.push_back({cur,cur-1});
					ans.push_back({cur-1,cur});
					cur++;
				}
			}
		}
	}
	for(int i = n;i>=1;--i){
		bool ok = false;
		for(int j = 1;j<=i;++j){
			if(b[j]==a[i]){
				ok = true;
			}
			else if(ok){
				ans.push_back({b[j],b[j-1]});
				swap(b[j-1],b[j]);
			}
		}
	}
	cout<<ans.size()<<endl;
	for(auto i:ans){
		cout<<i.first<<' '<<i.second<<endl;
	}
    return 0;
}


Submission (verdict: Accepted):
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<ll,ll>;
const int N = 1001;
ll a[N],b[N];
bool vis[N];
int main() {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    ll n;
    cin>>n;
    vector<pll> ans(0);
    for(int i = 1;i<=n;++i){
    	cin>>a[i];
    	b[i] = n-i+1;
	}
	for(int i = n;i>=2;--i){
		for(int j = i-1;j>=1;--j){
			ans.push_back({i,j});
		}
	}
	for(int i = 1;i<=n;++i){
		bool ok = false;
		for(int j = n;j>=i;--j){
			if(b[j]==a[i]){
				ok = true;
			}
			else if(ok){
				ans.push_back({b[j+1],b[j]});
				swap(b[j],b[j+1]);
			}
		}
	}
	cout<<ans.size()<<endl;
	for(auto i:ans){
		cout<<i.first<<' '<<i.second<<endl;
	}
    return 0;
}
Problem: 2063B - Subsequence Update
Language: C++20 (GCC 13-64)


Submission (verdict: Wrong answer on test 2):
﻿#include <algorithm>
#include <bitset>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <ctime>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <numeric>
#include <ostream>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stdexcept>
#include <string>
#include <thread>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

// using ul = __int128;
using dle = double;
using dlle = long double;
using ll = long long;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using pdle = pair<double, double>;
using pdlle = pair<long double, long double>;
using ull = unsigned long long;

using vc = vector<char>;
using vb = vector<bool>;
using vi = vector<int>;
using vl = vector<ll>;
using vpi = vector<pair<int, int>>;
using vpl = vector<pair<ll, ll>>;

using vvc = vector<vector<char>>;
using vvb = vector<vector<bool>>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;
using vvpi = vector<vector<pair<int, int>>>;
using vvpl = vector<vector<pair<ll, ll>>>;

using vh = unordered_set<ll>;
using vhm = unordered_map<ll, ll>;

const int INFi = 2e9;
const long long INF = 9e18;
const long long MOD = 1050000011;
const long long MMOD = 4611686018427387904;
const long double _PI = 3.14159265358979323846;
mt19937 rnd(time(0));
mt19937_64 rnd64(time(0));

void solut() {
    ll n, l, r;

    cin >> n >> l >> r;
    --l; --r;

    vl mas(n);

    for (int i = 0; i < n; i++) cin >> mas[i];

    vl stin;

    ll res = 0;
    for (int i = l; i <= r; i++) {
        res += mas[i];
        stin.push_back(mas[i]);
    }

    vl st;
    for (int i = 0; i < l; i++) {
        st.push_back(mas[i]);
    }
    for (int i = r + 1; i < n; i++) {
        st.push_back(mas[i]);
    }

    sort(stin.rbegin(), stin.rend());
    sort(st.begin(), st.end());
    
    ll l1 = 0, l2 = 0;
    while (l2 < st.size() && l1 < stin.size() && stin[l1] > st[l2]) {
        res -= stin[l1] - st[l2];
        ++l1; ++l2;
    }

    cout << res << "\n";
}

// ADMIN NE BANb PLZ
int main() {
    //cin.sync_with_stdio(false);
    //cin.tie(0);
    ll t = 1;
    cin >> t;

    while (t--) {
        solut();
    }
}
Problem: 2062C - Cirno and Operations
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 2):
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;
#define int long long
#define endl "\n"
void solve(){
	int n;
	cin >> n;
	vector<int>a(n+1);
	for(int i=1;i<=n;i++)cin >> a[i];
	if(n==1){
		cout << a[1] << endl;
		return ;
	}
	int ans=-1e9;
	for(int i=n-1;i>=1;i--){
		int  t=0;
		for(int j=1;j<=i+1;j++)t+=a[j];
		ans=max({ans,t,-t});
		for(int j=1;j<=i;j++){
			a[j]=a[j+1]-a[j];
		}
	}	
	cout << max({ans,a[1],-a[1]}) << endl;
}
signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int _=1;
	cin >> _;
	while(_--)
		solve();
}

Submission (verdict: Wrong answer on test 2):
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;
#define int long long
#define endl "\n"
void solve(){
	int n;
	cin >> n;
	vector<int>a(n+1);
	for(int i=1;i<=n;i++)cin >> a[i];
	if(n==1){
		cout << a[1] << endl;
		return ;
	}
	int ans=-1e9;
	for(int i=n-1;i>=1;i--){
		int  t=0;
		for(int j=1;j<=i+1;j++)t+=a[j];
		ans=max({ans,t});
		for(int j=1;j<=i;j++){
			a[j]=a[j+1]-a[j];
		}
	}	
	cout << max({ans,a[1],-a[1]}) << endl;
}
signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int _=1;
	cin >> _;
	while(_--)
		solve();
}
Problem: 2062C - Cirno and Operations
Language: C++23 (GCC 14-64, msys2)


Submission (verdict: Wrong answer on test 2):
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;
#define int long long
#define endl "\n"
void solve(){
	int n;
	cin >> n;
	vector<int>a(n+1);
	for(int i=1;i<=n;i++)cin >> a[i];
	if(n==1){
		cout << a[1] << endl;
		return ;
	}
	int ans=-1e9;
	for(int i=n-1;i>=1;i--){
		int  t=0;
		for(int j=1;j<=i+1;j++)t+=a[j];
		ans=max({ans,t,-t});
		for(int j=1;j<=i;j++){
			a[j]=a[j+1]-a[j];
		}
	}	
	cout << max({ans,a[1],-a[1]}) << endl;
}
signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int _=1;
	cin >> _;
	while(_--)
		solve();
}
Problem: 2062C - Cirno and Operations
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 2):
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;
#define int long long
#define endl "\n"
void solve(){
	int n;
	cin >> n;
	vector<int>a(n+1);
	for(int i=1;i<=n;i++)cin >> a[i];
	if(n==1){
		cout << a[1] << endl;
		return ;
	}
	int ans=-1e9;
	for(int i=n-1;i>=1;i--){
		int  t=0;
		for(int j=1;j<=i+1;j++)t+=a[j];
		ans=max({ans,t});
		for(int j=1;j<=i;j++){
			a[j]=a[j+1]-a[j];
		}
	}	
	cout << max({ans,a[1],-a[1]}) << endl;
}
signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int _=1;
	cin >> _;
	while(_--)
		solve();
}

Submission (verdict: Accepted):
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;
#define int long long
#define endl "\n"
void solve(){
	int n;
	cin >> n;
	vector<int>a(n+1);
	for(int i=1;i<=n;i++)cin >> a[i];
	if(n==1){
		cout << a[1] << endl;
		return ;
	}
	int ans=-1e9;
	for(int i=n-1;i>=1;i--){
		int  t=0;
		for(int j=1;j<=i+1;j++)t+=a[j];
		if(i==n-1)ans=max({ans,t});
		else{
			ans=max({ans,-t,t});
		}
		for(int j=1;j<=i;j++){
			a[j]=a[j+1]-a[j];
		}
	}	
	cout << max({ans,a[1],-a[1]}) << endl;
}
signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int _=1;
	cin >> _;
	while(_--)
		solve();
}