ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2060D - Subtract Min Sort
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 2):
//template owner:professor
#include <iostream>
using namespace std;
#define ll long long
#define pb push_back
#define rep(i,n) for(long long int  i=0;i<n;i++)
#define vi std::vector<int> 
const long long int MOD=1e9+7;
#define vli std::vector<long long int>
#define si std::set<int> 
#define sli std::set<long long int > 
#define qi std::queue<int > 
#define qli std::queue<long long int >
#define mli std::map<long long int ,long long int> 
#define mc std::map<char, long long int> 
#define umli std::unordered_map<long long int,long long int>
#define umc std::unordered_map<char,long long int>
#define gap ' '
#define ff first
#define ss second	
#include<cmath>
#include<bits/stdc++.h>
void solve()
{
//  1 5 6 2 3
//  0 4 6 2 3
//  0 0 2 2 3
 
 // odd size pair should 
int n; 
cin>> n;
 int val =1;
 int a[n];
for(int i = 0; i< n; ++i)
{
    cin>>a[i];
}

for(int i = 1; i< n; ++i)
{

    if(a[i] >=a[i-1]) val ++;
    else {
        if(((val &1) ^1) ){
            cout<<"NO"<<endl;
            return;
        }
        if(i !=n-1 && a[i] > a[i+1]) {
            cout<<"NO"<<endl;
            return;
        }
        val =0;
    }
        a[i] -=a[i-1];
}  
cout<<"YES"<<endl;
  
  
}
 
int main() {
         ios_base::sync_with_stdio(false);
     cin.tie(NULL);
     cout.tie(NULL);
ll t;
cin>>t;
while(t--)
{
solve();
}
 
	// your code goes here
	return 0;
}

Submission (verdict: Wrong answer on test 2):
//template owner:professor
#include <iostream>
using namespace std;
#define ll long long
#define pb push_back
#define rep(i,n) for(long long int  i=0;i<n;i++)
#define vi std::vector<int> 
const long long int MOD=1e9+7;
#define vli std::vector<long long int>
#define si std::set<int> 
#define sli std::set<long long int > 
#define qi std::queue<int > 
#define qli std::queue<long long int >
#define mli std::map<long long int ,long long int> 
#define mc std::map<char, long long int> 
#define umli std::unordered_map<long long int,long long int>
#define umc std::unordered_map<char,long long int>
#define gap ' '
#define ff first
#define ss second	
#include<cmath>
#include<bits/stdc++.h>
void solve()
{
//  1 5 6 2 3
//  0 4 6 2 3
//  0 0 2 2 3
 
 // odd size pair should 
int n; 
cin>> n;
 int val =1;
 int a[n];
for(int i = 0; i< n; ++i)
{
    cin>>a[i];
}

for(int i = 1; i< n; ++i)
{

    if(a[i] >=a[i-1]) val ++;
    else {
        val++;
        if(((val &1) ^1) ){
            cout<<"NO"<<endl;
            return;
        }
        if(i !=n-1 && a[i] > a[i+1]) {
            cout<<"NO"<<endl;
            return;
        }
        val =0;
    }
        a[i] -=a[i-1];
}  
cout<<"YES"<<endl;
  
  
}
 
int main() {
         ios_base::sync_with_stdio(false);
     cin.tie(NULL);
     cout.tie(NULL);
ll t;
cin>>t;
while(t--)
{
solve();
}
 
	// your code goes here
	return 0;
}
Problem: 2060D - Subtract Min Sort
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 2):
//template owner:professor
#include <iostream>
using namespace std;
#define ll long long
#define pb push_back
#define rep(i,n) for(long long int  i=0;i<n;i++)
#define vi std::vector<int> 
const long long int MOD=1e9+7;
#define vli std::vector<long long int>
#define si std::set<int> 
#define sli std::set<long long int > 
#define qi std::queue<int > 
#define qli std::queue<long long int >
#define mli std::map<long long int ,long long int> 
#define mc std::map<char, long long int> 
#define umli std::unordered_map<long long int,long long int>
#define umc std::unordered_map<char,long long int>
#define gap ' '
#define ff first
#define ss second	
#include<cmath>
#include<bits/stdc++.h>
void solve()
{
//  1 5 6 2 3
//  0 4 6 2 3
//  0 0 2 2 3
 
 // odd size pair should 
int n; 
cin>> n;
 int val =1;
 int a[n];
for(int i = 0; i< n; ++i)
{
    cin>>a[i];
}

for(int i = 1; i< n; ++i)
{

    if(a[i] >=a[i-1]) val ++;
    else {
        val++;
        if(((val &1) ^1) ){
            cout<<"NO"<<endl;
            return;
        }
        if(i !=n-1 && a[i] > a[i+1]) {
            cout<<"NO"<<endl;
            return;
        }
        val =0;
    }
        a[i] -=a[i-1];
}  
cout<<"YES"<<endl;
  
  
}
 
int main() {
         ios_base::sync_with_stdio(false);
     cin.tie(NULL);
     cout.tie(NULL);
ll t;
cin>>t;
while(t--)
{
solve();
}
 
	// your code goes here
	return 0;
}

Submission (verdict: Wrong answer on test 1):
//template owner:professor
#include <iostream>
using namespace std;
#define ll long long
#define pb push_back
#define rep(i,n) for(long long int  i=0;i<n;i++)
#define vi std::vector<int> 
const long long int MOD=1e9+7;
#define vli std::vector<long long int>
#define si std::set<int> 
#define sli std::set<long long int > 
#define qi std::queue<int > 
#define qli std::queue<long long int >
#define mli std::map<long long int ,long long int> 
#define mc std::map<char, long long int> 
#define umli std::unordered_map<long long int,long long int>
#define umc std::unordered_map<char,long long int>
#define gap ' '
#define ff first
#define ss second	
#include<cmath>
#include<bits/stdc++.h>
void solve()
{
//  1 5 6 2 3
//  0 4 6 2 3
//  0 0 2 2 3
 
 // odd size pair should 
int n; 
cin>> n;
 int val =1;
 int a[n];
for(int i = 0; i< n; ++i)
{
    cin>>a[i];
}

for(int i = 1; i< n; ++i)
{

    if(a[i] >=a[i-1]) val ++;
    else {
        val++;
        if(((val &1) ^1) ){
            cout<<"NO"<<endl;
            return;
        }
        if(i !=n-1 && a[i] > a[i+1]) {
            cout<<"NO"<<endl;
            return;
        }
        val =0;
    }
        a[i] -=a[i-1];
}  
for(int i = 1; i< n; ++i) {
    if(a[i] <a[i-1]){ cout<<"NO"<<endl;
            return;}
    
}
cout<<"YES"<<endl;
  
  
}
 
int main() {
         ios_base::sync_with_stdio(false);
     cin.tie(NULL);
     cout.tie(NULL);
ll t;
cin>>t;
while(t--)
{
solve();
}
 
	// your code goes here
	return 0;
}
Problem: 2060D - Subtract Min Sort
Language: C++17 (GCC 7-32)


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

using namespace std;



#define int long long

#define size_t long long

#define double long double



#define el cout << "\n"

const int M = 1000000007;

const int mod = 998244353;

#define YES cout << "YES"

#define Yes cout << "Yes"

#define NO cout << "NO"

#define No cout << "No"



#define vi vector<int>

#define pii pair<int,int>

#define vii vector<pair<int, int> >

#define vv vector<vector<int>>

#define vv2d(row, col, name) vector<vector<int>> name(row, vector<int>(col))

#define all(x) (x).begin(), (x).end()



#ifdef CPH

#define debug(x) cout << #x << " = " << x << '\n';

#define vdebug(a) cout << #a << " = "; for(auto x: a) cout << x << ' '; cout << '\n';

#else

#define debug(x)

#define vdebug(a)

#endif



int binMultiply(int a, int b) {

int ans = 0;

while (b) {

if (b & 1)

ans = (ans + a) % M;

b >>= 1;

a = (a + a) % M;

}

return ans;

}



int largeBinExpo(int a, int b, int M) {

a = a % M;

int ans = 1;

while (b) {

if (b & 1)

ans = binMultiply(ans, a);

b >>= 1;

a = binMultiply(a, a);

}

return ans;

}

int binPow(int a, int b, int M) {

int ans = 1;

while (b) {

if (b & 1)

ans = (ans * 1ll * a) % M;

a = (a * 1ll * a) % M;

b >>= 1;

}

return ans;

}



signed main() {

ios_base::sync_with_stdio(false);

cin.tie(NULL);

int t = 1;

cin >> t;

while (t--) {

int n;

cin >> n;

n++;

vi v(n);

for (size_t i = 1; i < n; i++)

{

cin >> v[i];

}

bool ok = true;

for (size_t i = 0; i < n - 1; i++)

{

if (v[i] > v[i + 1]) {

if (v[i] - v[i + 1] <= v[i - 1] - v[i - 2]) {

v[i] -= (v[i - 1] - v[i - 2]);

v[i - 1] = 0;

}

else {

ok = !ok;

break;

}

}

}



if (ok)YES;else NO;



cout << "\n";

}

}
Problem: 2050C - Uninteresting Number
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	int t;
	cin>>t;
	while(t--)
	{
		string s;
		cin>>s;
		int sum=0;
		int to=0;
		int th=0;
		for(int i=0;i<s.size();i++){
			sum+=(s[i]-'0');
			if(s[i]=='2')to++;
			if(s[i]=='3')th++;
		}
		int p=9-(sum%9);
		if(p==9){cout<<"YES\n";
		continue;}
		if(p==2&&to>0)cout<<"YES\n";
		else if(p==4&&to>1)cout<<"YES\n";
		else if((p==6)&&(to>2||th>0))cout<<"YES\n";
		else if(p==3&&th>1)cout<<"YES\n";
		else if(p==8&&(to>3|(to>0&&th>0)))cout<<"YES\n";
		else if(p==7&&((to>6)|(th>1&&to>0)|(th>0&&to>3))){
			cout<<"YES\n";
		}
		else if(p==5&&((to>4)|(th>0&&to>1))){
           cout<<"YES\n";
		}
        else cout<<"NO\n";
 
 
	}
	
    return 0;
}

Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	int t;
	cin>>t;
	while(t--)
	{
		string s;
		cin>>s;
		int sum=0;
		int to=0;
		int th=0;
		for(int i=0;i<s.size();i++){
			sum+=(s[i]-'0');
			if(s[i]=='2')to++;
			if(s[i]=='3')th++;
		}
		int p=9-(sum%9);
		if(p==9){cout<<"YES\n";
		continue;}

		if(p==2&&to>0)cout<<"YES\n";
		else if(p==1&&to>0)cout<<"YES\n";
		else if(p==4&&to>1)cout<<"YES\n";
		else if((p==6)&&(to>2||th>0))cout<<"YES\n";
		else if(p==3&&th>1)cout<<"YES\n";
		else if(p==8&&(to>3|(to>0&&th>0)))cout<<"YES\n";
		else if(p==7&&((to>6)|(th>1&&to>0)|(th>0&&to>3))){
			cout<<"YES\n";
		}
		else if(p==5&&((to>4)|(th>0&&to>1))){
           cout<<"YES\n";
		}
        else cout<<"NO\n";
 
 
	}
	
    return 0;
}
Problem: 2050C - Uninteresting Number
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	int t;
	cin>>t;
	while(t--)
	{
		string s;
		cin>>s;
		int sum=0;
		int to=0;
		int th=0;
		for(int i=0;i<s.size();i++){
			sum+=(s[i]-'0');
			if(s[i]=='2')to++;
			if(s[i]=='3')th++;
		}
		int p=9-(sum%9);
		if(p==9){cout<<"YES\n";
		continue;}
		if(p==2&&to>0)cout<<"YES\n";
		else if(p==4&&to>1)cout<<"YES\n";
		else if((p==6)&&(to>2||th>0))cout<<"YES\n";
		else if(p==3&&th>1)cout<<"YES\n";
		else if(p==8&&(to>3|(to>0&&th>0)))cout<<"YES\n";
		else if(p==7&&((to>6)|(th>1&&to>0)|(th>0&&to>3))){
			cout<<"YES\n";
		}
		else if(p==5&&((to>4)|(th>0&&to>1))){
           cout<<"YES\n";
		}
        else cout<<"NO\n";


	}
	
    return 0;
}

Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	int t;
	cin>>t;
	while(t--)
	{
		string s;
		cin>>s;
		int sum=0;
		int to=0;
		int th=0;
		for(int i=0;i<s.size();i++){
			sum+=(s[i]-'0');
			if(s[i]=='2')to++;
			if(s[i]=='3')th++;
		}
		int p=9-(sum%9);
		if(p==9){cout<<"YES\n";
		continue;}
		if(p==2&&to>0)cout<<"YES\n";
		else if(p==4&&to>1)cout<<"YES\n";
		else if((p==6)&&(to>2||th>0))cout<<"YES\n";
		else if(p==3&&th>1)cout<<"YES\n";
		else if(p==8&&(to>3|(to>0&&th>0)))cout<<"YES\n";
		else if(p==7&&((to>6)|(th>1&&to>0)|(th>0&&to>3))){
			cout<<"YES\n";
		}
		else if(p==5&&((to>4)|(th>0&&to>1))){
           cout<<"YES\n";
		}
        else cout<<"NO\n";
 
 
	}
	
    return 0;
}
Problem: 2050C - Uninteresting Number
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	int t;
	cin>>t;
	while(t--)
	{
		string s;
		cin>>s;
		int sum=0;
		int to=0;
		int th=0;
		for(int i=0;i<s.size();i++){
			sum+=(s[i]-'0');
			if(s[i]=='2')to++;
			if(s[i]=='3')th++;
		}
		int p=9-(sum%9);
		if(p==9){cout<<"YES\n";
		continue;}
		if(p==2&&to>0)cout<<"YES\n";
		else if(p==4&&to>1)cout<<"YES\n";
		else if((p==6)&&(to>2||th>0))cout<<"YES\n";
		else if(p==3&&th>1)cout<<"YES\n";
		else if(p==8&&(to>3|(to>0&&th>0)))cout<<"YES\n";
		else if(p==7&&((to>6)|(th>1&&to>0)|(th>0&&to>3))){
			cout<<"YES\n";
		}
		else if(p==5&&((to>4)|(th>0&&to>1))){
           cout<<"YES\n";
		}
        else cout<<"NO\n";


	}
	
    return 0;
}
Problem: 2050C - Uninteresting Number
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	int t;
	cin>>t;
	while(t--)
	{
		string s;
		cin>>s;
		int sum=0;
		int to=0;
		int th=0;
		for(int i=0;i<s.size();i++){
			sum+=(s[i]-'0');
			if(s[i]=='2')to++;
			if(s[i]=='3')th++;
		}
		int p=9-(sum%9);
		if(p==9){cout<<"YES\n";
		continue;}

		if(p==2&&to>0)cout<<"YES\n";
		else if(p==1&&to>0)cout<<"YES\n";
		else if(p==4&&to>1)cout<<"YES\n";
		else if((p==6)&&(to>2||th>0))cout<<"YES\n";
		else if(p==3&&th>1)cout<<"YES\n";
		else if(p==8&&(to>3|(to>0&&th>0)))cout<<"YES\n";
		else if(p==7&&((to>6)|(th>1&&to>0)|(th>0&&to>3))){
			cout<<"YES\n";
		}
		else if(p==5&&((to>4)|(th>0&&to>1))){
           cout<<"YES\n";
		}
        else cout<<"NO\n";
 
 
	}
	
    return 0;
}

Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	int t;
	cin>>t;
	while(t--)
	{
		string s;
		cin>>s;
		int sum=0;
		int to=0;
		int th=0;
		for(int i=0;i<s.size();i++){
			sum+=(s[i]-'0');
			if(s[i]=='2')to++;
			if(s[i]=='3')th++;
		}
		int p=9-(sum%9);
		if(p==9){cout<<"YES\n";
		continue;}

		if(p==2&&to>0)cout<<"YES\n";
		else if(p==1&&((to>4)|(th>0&&to>1)))cout<<"YES\n";
		else if(p==4&&to>1)cout<<"YES\n";
		else if((p==6)&&(to>2||th>0))cout<<"YES\n";
		else if(p==3&&th>1)cout<<"YES\n";
		else if(p==8&&(to>3|(to>0&&th>0)))cout<<"YES\n";
		else if(p==7&&((to>6)|(th>1&&to>0)|(th>0&&to>3))){
			cout<<"YES\n";
		}
		else if(p==5&&((to>4)|(th>0&&to>1))){
           cout<<"YES\n";
		}
        else cout<<"NO\n";
 
 
	}
	
    return 0;
}
Problem: 2050C - Uninteresting Number
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	int t;
	cin>>t;
	while(t--)
	{
		string s;
		cin>>s;
		int sum=0;
		int to=0;
		int th=0;
		for(int i=0;i<s.size();i++){
			sum+=(s[i]-'0');
			if(s[i]=='2')to++;
			if(s[i]=='3')th++;
		}
		int p=9-(sum%9);
		if(p==9){cout<<"YES\n";
		continue;}

		if(p==2&&to>0)cout<<"YES\n";
		else if(p==1&&((to>4)|(th>0&&to>1)))cout<<"YES\n";
		else if(p==4&&to>1)cout<<"YES\n";
		else if((p==6)&&(to>2||th>0))cout<<"YES\n";
		else if(p==3&&th>1)cout<<"YES\n";
		else if(p==8&&(to>3|(to>0&&th>0)))cout<<"YES\n";
		else if(p==7&&((to>6)|(th>1&&to>0)|(th>0&&to>3))){
			cout<<"YES\n";
		}
		else if(p==5&&((to>4)|(th>0&&to>1))){
           cout<<"YES\n";
		}
        else cout<<"NO\n";
 
 
	}
	
    return 0;
}

Submission (verdict: Accepted):
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	int t;
	cin>>t;
	while(t--)
	{
		string s;
		cin>>s;
		int sum=0;
		int to=0;
		int th=0;
		for(int i=0;i<s.size();i++){
			sum+=(s[i]-'0');
			if(s[i]=='2')to++;
			if(s[i]=='3')th++;
		}
		int p=9-(sum%9);
		if(p==9){cout<<"YES\n";
		continue;}

		if(p==2&&to>0)cout<<"YES\n";
		else if(p==1&&(to>=5 || (to>=2 && th>=1)))cout<<"YES\n";
		else if(p==4&&to>1)cout<<"YES\n";
		else if((p==6)&&(to>2||th>0))cout<<"YES\n";
		else if(p==3&&(to>=6 || th>=2 || (th>=1 && to>=3)))cout<<"YES\n";
		else if(p==8&&(to>3|(to>0&&th>0)))cout<<"YES\n";
		else if(p==7&&(to>=8 || (to>=2 && th>=2) || (to>=5 && th>=1))){
			cout<<"YES\n";
		}
		else if(p==5&&(to>=7 || (to>=1 && th>=2) || (to>=4 && th>=1)) ){
           cout<<"YES\n";
		}
        else cout<<"NO\n";
 
 
	}
	
    return 0;
}
Problem: 2062C - Cirno and Operations
Language: C++23 (GCC 14-64, msys2)


Submission (verdict: Wrong answer on test 2):
#include <iostream>
#include<algorithm>
#include<vector>
using namespace std;
vector<long>a;
int main()
{
	int t, n; cin >> t;
	while (t--)
	{
		a.clear();
		cin >> n;
		for (int i = 0; i < n; i++)
		{
			int temp; cin >> temp; a.emplace_back(temp);
		}
		long ans = -60000; int now = n;
		for (int i = 0; i < n; i++)
		{
			long sum = 0;
			for (int j = 0; j < now; j++)
			{
				sum += a[j];
			}
			if (i == 0) ans = max(ans, sum);
			else ans = max(ans, max(sum, -sum));
			for (int j = 0; j < now - 1; j++) a[j] = a[j + 1] - a[j];
			now--;
		}
		cout << ans << "\n";
	}
	return 0;
}
Problem: 2062C - Cirno and Operations
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 2):
#include <iostream>
#include<algorithm>
#include<vector>
using namespace std;
vector<long>a;
int main()
{
	int t, n; cin >> t;
	while (t--)
	{
		a.clear();
		cin >> n;
		for (int i = 0; i < n; i++)
		{
			int temp; cin >> temp; a.emplace_back(temp);
		}
		long ans = -1e18; int now = n;
		for (int i = 0; i < n; i++)
		{
			long sum = 0;
			for (int j = 0; j < now; j++)
			{
				sum += a[j];
			}
			if (i == 0) ans = max(ans, sum);
			else ans = max(ans, max(sum, -sum));
			for (int j = 0; j < now - 1; j++) a[j] = a[j + 1] - a[j];
			now--;
		}
		cout << ans << "\n";
	}
	return 0;
}

Submission (verdict: Wrong answer on test 2):
#include <iostream>
#include<algorithm>
#include<vector>
using namespace std;
vector<long>a;
int main()
{
	int t, n; cin >> t;
	while (t--)
	{
		a.clear();
		cin >> n;
		for (int i = 0; i < n; i++)
		{
			int temp; cin >> temp; a.emplace_back(temp);
		}
		long long ans = -1e18; int now = n;
		for (int i = 0; i < n; i++)
		{
			long long sum = 0;
			for (int j = 0; j < now; j++)
			{
				sum += a[j];
			}
			if (i == 0) ans = max(ans, sum);
			else ans = max(ans, max(sum, -sum));
			for (int j = 0; j < now - 1; j++) a[j] = a[j + 1] - a[j];
			now--;
		}
		cout << ans << "\n";
	}
	return 0;
}
Problem: 2062C - Cirno and Operations
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 2):
#include <iostream>
#include<algorithm>
#include<vector>
using namespace std;
vector<long>a;
int main()
{
	int t, n; cin >> t;
	while (t--)
	{
		a.clear();
		cin >> n;
		for (int i = 0; i < n; i++)
		{
			int temp; cin >> temp; a.emplace_back(temp);
		}
		long long ans = -1e18; int now = n;
		for (int i = 0; i < n; i++)
		{
			long long sum = 0;
			for (int j = 0; j < now; j++)
			{
				sum += a[j];
			}
			if (i == 0) ans = max(ans, sum);
			else ans = max(ans, max(sum, -sum));
			for (int j = 0; j < now - 1; j++) a[j] = a[j + 1] - a[j];
			now--;
		}
		cout << ans << "\n";
	}
	return 0;
}

Submission (verdict: Accepted):
#include <iostream>
#include<algorithm>
#include<vector>
using namespace std;
vector<long long>a;
int main()
{
	int t, n; cin >> t;
	while (t--)
	{
		a.clear();
		cin >> n;
		for (int i = 0; i < n; i++)
		{
			int temp; cin >> temp; a.emplace_back(temp);
		}
		long long ans = -1e18; int now = n;
		for (int i = 0; i < n; i++)
		{
			long long sum = 0;
			for (int j = 0; j < now; j++)
			{
				sum += a[j];
			}
			if (i == 0) ans = max(ans, sum);
			else ans = max(ans, max(sum, -sum));
			for (int j = 0; j < now - 1; j++) a[j] = a[j + 1] - a[j];
			now--;
		}
		cout << ans << "\n";
	}
	return 0;
}
Problem: 2062C - Cirno and Operations
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 2):
#include <iostream>
#include<algorithm>
#include<vector>
using namespace std;
vector<long>a;
int main()
{
	int t, n; cin >> t;
	while (t--)
	{
		a.clear();
		cin >> n;
		for (int i = 0; i < n; i++)
		{
			int temp; cin >> temp; a.emplace_back(temp);
		}
		long ans = -60000; int now = n;
		for (int i = 0; i < n; i++)
		{
			long sum = 0;
			for (int j = 0; j < now; j++)
			{
				sum += a[j];
			}
			if (i == 0) ans = max(ans, sum);
			else ans = max(ans, max(sum, -sum));
			for (int j = 0; j < now - 1; j++) a[j] = a[j + 1] - a[j];
			now--;
		}
		cout << ans << "\n";
	}
	return 0;
}

Submission (verdict: Wrong answer on test 2):
#include <iostream>
#include<algorithm>
#include<vector>
using namespace std;
vector<long>a;
int main()
{
	int t, n; cin >> t;
	while (t--)
	{
		a.clear();
		cin >> n;
		for (int i = 0; i < n; i++)
		{
			int temp; cin >> temp; a.emplace_back(temp);
		}
		long ans = -1e18; int now = n;
		for (int i = 0; i < n; i++)
		{
			long sum = 0;
			for (int j = 0; j < now; j++)
			{
				sum += a[j];
			}
			if (i == 0) ans = max(ans, sum);
			else ans = max(ans, max(sum, -sum));
			for (int j = 0; j < now - 1; j++) a[j] = a[j + 1] - a[j];
			now--;
		}
		cout << ans << "\n";
	}
	return 0;
}
Problem: 2063C - Remove Exactly Two
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define pb push_back
#define str string
#define sz(a) (int) a.size()
#define all(a) a.begin(), a.end()
#define fi first
#define se second
using namespace std;

bool comp(pair<int,int>& a,pair<int,int>& b){
    return a.se > b.se;
}

void solve(){
    int n,u,v;
    cin >> n;
    vector<vector<int>> g(n);
    for(int i = 0;i<n-1;++i){
        cin >> u >> v;
        u--, v--;
        g[u].pb(v);
        g[v].pb(u);
    }
    vector<pair<int,int>> s;
    for(int i = 0;i<n;++i) s.pb({i,sz(g[i])});
    sort(all(s), comp);
    for(int i = 1;i<n;++i){
        bool k = false;
        for(int j : g[s[i].fi]){
            if(j == s[0].fi){
                k = true;
            }
        }
        if(k) s[i].se--;
    }
    sort(all(s), comp);
    cout << s[0].se + s[1].se - 1 << '\n';
}
signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    int t;
    cin >> t;
    while(t--) solve();
}

Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define pb push_back
#define str string
#define sz(a) (int) a.size()
#define all(a) a.begin(), a.end()
#define fi first
#define se second
using namespace std;
const int N = 2e5+7;
const int inf = 1e9;
int dist[N];
bool comp(pair<int,int>& a,pair<int,int>& b){
    if(a.se == b.se) return dist[a.fi] < dist[b.fi];
    return a.se > b.se;
}

void bfs(vector<vector<int>>& g){
    int n = sz(g);
    for(int i = 0;i<n;++i){
        dist[i] = inf;
    }
    queue<int> q;
    for(int i = 0;i<n;++i){
        if(sz(g[i]) == 1){
            dist[i] = 0;
            q.push(i);
        }
    }
    while(!q.empty()){
        int v = q.front();
        q.pop();

        for(int i : g[v]){
            if(dist[i] > dist[v]+1){
                dist[i] = dist[v]+1;
                q.push(i);
            }
        }
    }
}

void solve(){
    int n,u,v;
    cin >> n;
    vector<vector<int>> g(n);
    for(int i = 0;i<n-1;++i){
        cin >> u >> v;
        u--, v--;
        g[u].pb(v);
        g[v].pb(u);
    }
    bfs(g);
    vector<pair<int,int>> s;
    for(int i = 0;i<n;++i) s.pb({i,sz(g[i])});
    sort(all(s), comp);
    for(int i = 1;i<n;++i){
        bool k = false;
        for(int j : g[s[i].fi]){
            if(j == s[0].fi){
                k = true;
            }
        }
        if(k) s[i].se--;
    }
    sort(all(s), comp);
    cout << s[0].se + s[1].se - 1 << '\n';
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    int t;
    cin >> t;
    while(t--) solve();
}