ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2050C - Uninteresting Number
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 3):
#include <iostream>
#include <cstring>
#include <cmath>

using namespace std;

const int N = 1e5 + 10;
char a[N];

int main()
{
    int n;
    cin >> n;
    while (n --)
    {
        int tows = 0, threes = 0;
        scanf("%s",a);
        int len = strlen(a);
        long long sum = 0;
        for (int i = 0; i < len; i ++)
        {
            if (a[i] == '2') tows ++;
            else if (a[i] == '3') threes ++;
            sum = sum + a[i] - '0';
        }
        
        bool flag = false;
        for (int i = 0; i < min(tows + 1, 9); i ++)
            for (int j = 0; j < min(threes + 1, 9); j ++)
            {
                if ((long long)(sum + i * 2 + j * 6) % 9 == 0)
                {
                    puts("yes");
                    flag = true;
                    break;
                }
            }
        if (!flag) puts("no");
    }
    return 0;
}

Submission (verdict: Accepted):
#include <iostream>
#include <cstring>
#include <cmath>

using namespace std;

const int N = 1e5 + 10;
char a[N];

int main()
{
    int n;
    cin >> n;
    while (n --)
    {
        int tows = 0, threes = 0;
        scanf("%s",a);
        int len = strlen(a);
        long long sum = 0;
        for (int i = 0; i < len; i ++)
        {
            if (a[i] == '2') tows ++;
            else if (a[i] == '3') threes ++;
            sum = sum + a[i] - '0';
        }
        
        bool flag = false;
        for (int i = 0; i < min(tows + 1, 9); i ++)
        {
            for (int j = 0; j < min(threes + 1, 9); j ++)
            {
                if ((long long)(sum + i * 2 + j * 6) % 9 == 0)
                {
                    puts("yes");
                    flag = true;
                    break;
                }
            }
            if (flag) break;
        }
        if (!flag) puts("no");

    }
    return 0;
}
Problem: 2050D - Digital string maximization
Language: C++20 (GCC 13-64)

Previous submission (verdict: Time limit exceeded on test 6):

#include     <bits/stdc++.h>
using        namespace std;

#define     pb push_back
#define     endl "\n"
#define     take cin >> 
#define     ll long long
#define     pii pair<int, int>
#define     all(v) v.begin(),v.end()
#define     read(v) for(auto& temp : v) cin >> temp
#define     precision(n) fixed << setprecision(n)
#define     debug(x) cout << #x << " = " << x << endl
#define     print(v) for(auto tem : v) cout << tem << ' '; cout << endl
#define     miuu ios_base::sync_with_stdio(false);cin.tie(nullptr); cout.tie(nullptr)


const int   N = 1e9;
const int   mod = 1e9 + 7;
const int   inf = 1e9 + 9;
const int   dx[] = {0, 0, 1, -1, -1, 1, -1, 1};
const int   dy[] = {1, -1, 0, 0, -1, -1, 1, 1};

map < ll, ll > m;

void solution() { 
  string str;
  cin >> str;
  int n = str.size();

  int idx = 0, mx = 1e9;

for(int i = 0; i < n; i++){
  int o = str[i] - '0';
  bool find = false;
  idx = 0;
  for(int j = i + 1; j < n; j++){
    int t = str[j] - '0';
    if(t - (j - i) > o){
      o = t - (j - i);
      idx = j;
      find = true;
    }
  }
  // cout << str << " "  << i << " " << idx << endl;
  if(find){
  for(int k = idx; k > i + 1; k--){
        str[k] = str[k - 1];
      }
      str[i + 1] = str[i];
      str[i] = o + '0';

}
}

  cout << str << endl;
}

int main()
{
    miuu;

    int case_number = 1; 
    cin >> case_number;
    while (case_number--) {
        solution();
    }
    return 0;
}

Submission (verdict: Accepted):

#include     <bits/stdc++.h>
using        namespace std;

#define     pb push_back
#define     endl "\n"
#define     take cin >> 
#define     ll long long
#define     pii pair<int, int>
#define     all(v) v.begin(),v.end()
#define     read(v) for(auto& temp : v) cin >> temp
#define     precision(n) fixed << setprecision(n)
#define     debug(x) cout << #x << " = " << x << endl
#define     print(v) for(auto tem : v) cout << tem << ' '; cout << endl
#define     miuu ios_base::sync_with_stdio(false);cin.tie(nullptr); cout.tie(nullptr)


const int   N = 1e9;
const int   mod = 1e9 + 7;
const int   inf = 1e9 + 9;
const int   dx[] = {0, 0, 1, -1, -1, 1, -1, 1};
const int   dy[] = {1, -1, 0, 0, -1, -1, 1, 1};

map < ll, ll > m;

void solution() { 
  string str;
  cin >> str;
  int n = str.size();

  int idx = 0, mx = 1e9;

for(int i = 0; i < n; i++){
  int o = str[i] - '0';
  bool find = false;
  idx = 0;
  for(int j = i + 1; j <= min(n-1,i + 9); j++){
    int t = str[j] - '0';
    if(t - (j - i) > o){
      o = t - (j - i);
      idx = j;
      find = true;
    }
  }
  // cout << str << " "  << i << " " << idx << endl;
  if(find){
  for(int k = idx; k > i + 1; k--){
        str[k] = str[k - 1];
      }
      str[i + 1] = str[i];
      str[i] = o + '0';

}
}

  cout << str << endl;
}

int main()
{
    miuu;

    int case_number = 1; 
    cin >> case_number;
    while (case_number--) {
        solution();
    }
    return 0;
}
Problem: 2050D - Digital string maximization
Language: C++20 (GCC 13-64)


Submission (verdict: Time limit exceeded on test 6):

#include     <bits/stdc++.h>
using        namespace std;

#define     pb push_back
#define     endl "\n"
#define     take cin >> 
#define     ll long long
#define     pii pair<int, int>
#define     all(v) v.begin(),v.end()
#define     read(v) for(auto& temp : v) cin >> temp
#define     precision(n) fixed << setprecision(n)
#define     debug(x) cout << #x << " = " << x << endl
#define     print(v) for(auto tem : v) cout << tem << ' '; cout << endl
#define     miuu ios_base::sync_with_stdio(false);cin.tie(nullptr); cout.tie(nullptr)


const int   N = 1e9;
const int   mod = 1e9 + 7;
const int   inf = 1e9 + 9;
const int   dx[] = {0, 0, 1, -1, -1, 1, -1, 1};
const int   dy[] = {1, -1, 0, 0, -1, -1, 1, 1};

map < ll, ll > m;

void solution() { 
  string str;
  cin >> str;
  int n = str.size();

  int idx = 0, mx = 1e9;

for(int i = 0; i < n; i++){
  int o = str[i] - '0';
  bool find = false;
  for(int j = i + 1; j < n; j++){
    int t = str[j] - '0';
    if(t - (j - i) > o){
      // cout << t - (j - i) << endl;
      find = true;
      for(int k = j; k > i + 1; k--){
        str[k] = str[k - 1];
      }
      str[i + 1] = str[i];
      str[i] = t - (j - i) + '0';
      o = str[i] - '0';
      // cout <<  str << " hi " << i  << " " << j<< endl;
    }
    if(t - (j - i) > o) break;
  }



}

  cout << str << endl;
}

int main()
{
    miuu;

    int case_number = 1; 
    cin >> case_number;
    while (case_number--) {
        solution();
    }
    return 0;
}
Problem: 2050D - Digital string maximization
Language: C++20 (GCC 13-64)

Previous submission (verdict: Time limit exceeded on test 6):

#include     <bits/stdc++.h>
using        namespace std;

#define     pb push_back
#define     endl "\n"
#define     take cin >> 
#define     ll long long
#define     pii pair<int, int>
#define     all(v) v.begin(),v.end()
#define     read(v) for(auto& temp : v) cin >> temp
#define     precision(n) fixed << setprecision(n)
#define     debug(x) cout << #x << " = " << x << endl
#define     print(v) for(auto tem : v) cout << tem << ' '; cout << endl
#define     miuu ios_base::sync_with_stdio(false);cin.tie(nullptr); cout.tie(nullptr)


const int   N = 1e9;
const int   mod = 1e9 + 7;
const int   inf = 1e9 + 9;
const int   dx[] = {0, 0, 1, -1, -1, 1, -1, 1};
const int   dy[] = {1, -1, 0, 0, -1, -1, 1, 1};

map < ll, ll > m;

void solution() { 
  string str;
  cin >> str;
  int n = str.size();

  int idx = 0, mx = 1e9;

for(int i = 0; i < n; i++){
  int o = str[i] - '0';
  bool find = false;
  for(int j = i + 1; j < n; j++){
    int t = str[j] - '0';
    if(t - (j - i) > o){
      // cout << t - (j - i) << endl;
      find = true;
      for(int k = j; k > i + 1; k--){
        str[k] = str[k - 1];
      }
      str[i + 1] = str[i];
      str[i] = t - (j - i) + '0';
      o = str[i] - '0';
      // cout <<  str << " hi " << i  << " " << j<< endl;
    }
    if(t - (j - i) > o) break;
  }



}

  cout << str << endl;
}

int main()
{
    miuu;

    int case_number = 1; 
    cin >> case_number;
    while (case_number--) {
        solution();
    }
    return 0;
}

Submission (verdict: Time limit exceeded on test 6):

#include     <bits/stdc++.h>
using        namespace std;

#define     pb push_back
#define     endl "\n"
#define     take cin >> 
#define     ll long long
#define     pii pair<int, int>
#define     all(v) v.begin(),v.end()
#define     read(v) for(auto& temp : v) cin >> temp
#define     precision(n) fixed << setprecision(n)
#define     debug(x) cout << #x << " = " << x << endl
#define     print(v) for(auto tem : v) cout << tem << ' '; cout << endl
#define     miuu ios_base::sync_with_stdio(false);cin.tie(nullptr); cout.tie(nullptr)


const int   N = 1e9;
const int   mod = 1e9 + 7;
const int   inf = 1e9 + 9;
const int   dx[] = {0, 0, 1, -1, -1, 1, -1, 1};
const int   dy[] = {1, -1, 0, 0, -1, -1, 1, 1};

map < ll, ll > m;

void solution() { 
  string str;
  cin >> str;
  int n = str.size();

  int idx = 0, mx = 1e9;

for(int i = 0; i < n; i++){
  int o = str[i] - '0';
  bool find = false;
  idx = 0;
  for(int j = i + 1; j < n; j++){
    int t = str[j] - '0';
    if(t - (j - i) > o){
      o = t - (j - i);
      idx = j;
      find = true;
    }
  }
  // cout << str << " "  << i << " " << idx << endl;
  if(find){
  for(int k = idx; k > i + 1; k--){
        str[k] = str[k - 1];
      }
      str[i + 1] = str[i];
      str[i] = o + '0';

}
}

  cout << str << endl;
}

int main()
{
    miuu;

    int case_number = 1; 
    cin >> case_number;
    while (case_number--) {
        solution();
    }
    return 0;
}
Problem: 2062C - Cirno and Operations
Language: C++20 (GCC 13-64)


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

#define     pb push_back
#define     endl "\n"
#define     take cin >> 
#define     ll long long
#define     pii pair<int, int>
#define     all(v) v.begin(),v.end()
#define     read(v) for(auto& temp : v) cin >> temp
#define     precision(n) fixed << setprecision(n)
#define     debug(x) cout << #x << " = " << x << endl
#define     print(v) for(auto tem : v) cout << tem << ' '; cout << endl
#define     miuu ios_base::sync_with_stdio(false);cin.tie(nullptr); cout.tie(nullptr)


const int   N = 2e5 + 5;
const int   mod = 1e9 + 7;
const int   inf = 1e9 + 9;
const int   dx[] = {0, 0, 1, -1, -1, 1, -1, 1};
const int   dy[] = {1, -1, 0, 0, -1, -1, 1, 1};

int vis[N];
int lev[N];
int rel[N];
int n, m, t;


void solution() { 

  int n;
  cin >> n;

  vector < ll > arr;

  ll ans = -1e18;

  ll sum = 0;

  for(int i = 0; i < n; i++){
    int x;
    cin >> x;
    arr.push_back(x);
    sum += x;
  }
  if(n > 1) sum = - sum;

  ans = max (sum, ans);


  while(arr.size() > 1){

    vector < ll > b;
    sum = 0;

  for(int i = 1; i < arr.size(); i++){

    b.push_back(arr[i] - arr[i - 1]);
    sum += arr[i] - arr[i - 1];

  }

  ans = max ( ans, abs(sum));
  arr = b;
 } 
    
    cout << ans << endl;
}

int main()
{
    miuu;
    
    int case_number = 1;
    cin >> case_number;

    int c = 1;


    while (case_number--) {

        solution();

        // if(case_number != 0)cout << endl;
    }
    return 0;
}
Problem: 2062C - Cirno and Operations
Language: C++20 (GCC 13-64)

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

#define     pb push_back
#define     endl "\n"
#define     take cin >> 
#define     ll long long
#define     pii pair<int, int>
#define     all(v) v.begin(),v.end()
#define     read(v) for(auto& temp : v) cin >> temp
#define     precision(n) fixed << setprecision(n)
#define     debug(x) cout << #x << " = " << x << endl
#define     print(v) for(auto tem : v) cout << tem << ' '; cout << endl
#define     miuu ios_base::sync_with_stdio(false);cin.tie(nullptr); cout.tie(nullptr)


const int   N = 2e5 + 5;
const int   mod = 1e9 + 7;
const int   inf = 1e9 + 9;
const int   dx[] = {0, 0, 1, -1, -1, 1, -1, 1};
const int   dy[] = {1, -1, 0, 0, -1, -1, 1, 1};

int vis[N];
int lev[N];
int rel[N];
int n, m, t;


void solution() { 

  int n;
  cin >> n;

  vector < ll > arr;

  ll ans = -1e18;

  ll sum = 0;

  for(int i = 0; i < n; i++){
    int x;
    cin >> x;
    arr.push_back(x);
    sum += x;
  }
  if(n > 1) sum = - sum;

  ans = max (sum, ans);


  while(arr.size() > 1){

    vector < ll > b;
    sum = 0;

  for(int i = 1; i < arr.size(); i++){

    b.push_back(arr[i] - arr[i - 1]);
    sum += arr[i] - arr[i - 1];

  }

  ans = max ( ans, abs(sum));
  arr = b;
 } 
    
    cout << ans << endl;
}

int main()
{
    miuu;
    
    int case_number = 1;
    cin >> case_number;

    int c = 1;


    while (case_number--) {

        solution();

        // if(case_number != 0)cout << endl;
    }
    return 0;
}

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

#define     pb push_back
#define     endl "\n"
#define     take cin >> 
#define     ll long long
#define     pii pair<int, int>
#define     all(v) v.begin(),v.end()
#define     read(v) for(auto& temp : v) cin >> temp
#define     precision(n) fixed << setprecision(n)
#define     debug(x) cout << #x << " = " << x << endl
#define     print(v) for(auto tem : v) cout << tem << ' '; cout << endl
#define     miuu ios_base::sync_with_stdio(false);cin.tie(nullptr); cout.tie(nullptr)


const int   N = 2e5 + 5;
const int   mod = 1e9 + 7;
const int   inf = 1e9 + 9;
const int   dx[] = {0, 0, 1, -1, -1, 1, -1, 1};
const int   dy[] = {1, -1, 0, 0, -1, -1, 1, 1};

int vis[N];
int lev[N];
int rel[N];
int n, m, t;


void solution() { 

  int n;
  cin >> n;

  vector < ll > arr;

  ll ans = -1e18;

  ll sum = 0;

  for(int i = 0; i < n; i++){
    int x;
    cin >> x;
    arr.push_back(x);
    sum += x;
  }
  if(n > 1) ans = max (abs(sum), ans);
  else ans = max (sum, ans);

  while(arr.size() > 1){

    vector < ll > b;
    sum = 0;

  for(int i = 1; i < arr.size(); i++){

    b.push_back(arr[i] - arr[i - 1]);
    sum += arr[i] - arr[i - 1];

  }

  ans = max ( ans, abs(sum));
  arr = b;
 } 
    
    cout << ans << endl;
}

int main()
{
    miuu;
    
    int case_number = 1;
    cin >> case_number;

    int c = 1;


    while (case_number--) {

        solution();

        // if(case_number != 0)cout << endl;
    }
    return 0;
}
Problem: 2062C - Cirno and Operations
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 2):
#include<bits/stdc++.h>
 
using namespace std;
 
#define ll long long
#define mod 1000000007
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)
bool comp(int a,int b){
  return a>b;
}
ll fact(ll n){
  ll x=n; ll prod=1;
  if(n==0) return 1;
  else{
  while(x){
    prod*=x;
    x--;
  }
  return prod;
  }
}
ll C(ll n, ll r){
  return fact(n)/(fact(r)*fact(n-r));
}

int main(){
    fast_io;
    int test=1;
    cin >> test;
    while(test--){
     int n;
     cin>>n;
     vector <int> v(n);
     for(auto &x:v) cin>>x;
     ll sum=accumulate(v.begin(),v.end(),0ll);
     for(int i=1;i<n;i++){
      vector<int> v1(n-i);
      for(int j=0;j<n-i;j++) v1[j]=v[j+1]-v[j];
      sum=max(sum,abs(accumulate(v1.begin(),v1.end(),0ll)));
      v=v1;
     }
     cout<<sum<<endl;
    }
    return 0;

}

Submission (verdict: Accepted):
#include<bits/stdc++.h>
 
using namespace std;
 
#define ll long long
#define mod 1000000007
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)
bool comp(int a,int b){
  return a>b;
}
ll fact(ll n){
  ll x=n; ll prod=1;
  if(n==0) return 1;
  else{
  while(x){
    prod*=x;
    x--;
  }
  return prod;
  }
}
ll C(ll n, ll r){
  return fact(n)/(fact(r)*fact(n-r));
}

int main(){
    fast_io;
    int test=1;
    cin >> test;
    while(test--){
     int n;
     cin>>n;
     vector <ll> v(n);
     for(auto &x:v) cin>>x;
     ll sum=accumulate(v.begin(),v.end(),0ll);
     for(int i=1;i<n;i++){
      vector<ll> v1(n-i);
      for(int j=0;j<n-i;j++) v1[j]=v[j+1]-v[j];
      sum=max(sum,abs(accumulate(v1.begin(),v1.end(),0ll)));
      v=v1;
     }
     cout<<sum<<endl;
    }
    return 0;

}
Problem: 2062C - Cirno and Operations
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 2):
#include<bits/stdc++.h>
 
using namespace std;
 
#define ll long long
#define mod 1000000007
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)
bool comp(int a,int b){
  return a>b;
}
ll fact(ll n){
  ll x=n; ll prod=1;
  if(n==0) return 1;
  else{
  while(x){
    prod*=x;
    x--;
  }
  return prod;
  }
}
ll C(ll n, ll r){
  return fact(n)/(fact(r)*fact(n-r));
}

int main(){
    fast_io;
    int test=1;
    cin >> test;
    while(test--){
     int n;
     cin>>n;
     vector <int> v(n);
     for(auto &x:v) cin>>x;
     int sum=accumulate(v.begin(),v.end(),0);
     for(int i=1;i<n;i++){
      vector<int> v1(n-i);
      for(int j=0;j<n-i;j++) v1[j]=v[j+1]-v[j];
      sum=max(sum,abs(accumulate(v1.begin(),v1.end(),0)));
      v=v1;
     }
     cout<<sum<<endl;
    }
    return 0;

}
Problem: 2062C - Cirno and Operations
Language: C++17 (GCC 7-32)

Previous submission (verdict: Compilation error):
#include<bits/stdc++.h>
 
using namespace std;
 
#define ll long long
#define mod 1000000007
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)
bool comp(int a,int b){
  return a>b;
}
ll fact(ll n){
  ll x=n; ll prod=1;
  if(n==0) return 1;
  else{
  while(x){
    prod*=x;
    x--;
  }
  return prod;
  }
}
ll C(ll n, ll r){
  return fact(n)/(fact(r)*fact(n-r));
}

int main(){
    fast_io;
    int test=1;
    cin >> test;
    while(test--){
     int n;
     cin>>n;
     vector <int> v(n);
     for(auto &x:v) cin>>x;
     ll sum=accumulate(v.begin(),v.end(),0);
     for(int i=1;i<n;i++){
      vector<int> v1(n-i);
      for(int j=0;j<n-i;j++) v1[j]=v[j+1]-v[j];
      sum=max(sum,abs(accumulate(v1.begin(),v1.end(),0)));
      v=v1;
     }
     cout<<sum<<endl;
    }
    return 0;

}

Submission (verdict: Wrong answer on test 2):
#include<bits/stdc++.h>
 
using namespace std;
 
#define ll long long
#define mod 1000000007
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)
bool comp(int a,int b){
  return a>b;
}
ll fact(ll n){
  ll x=n; ll prod=1;
  if(n==0) return 1;
  else{
  while(x){
    prod*=x;
    x--;
  }
  return prod;
  }
}
ll C(ll n, ll r){
  return fact(n)/(fact(r)*fact(n-r));
}

int main(){
    fast_io;
    int test=1;
    cin >> test;
    while(test--){
     int n;
     cin>>n;
     vector <int> v(n);
     for(auto &x:v) cin>>x;
     ll sum=accumulate(v.begin(),v.end(),0ll);
     for(int i=1;i<n;i++){
      vector<int> v1(n-i);
      for(int j=0;j<n-i;j++) v1[j]=v[j+1]-v[j];
      sum=max(sum,abs(accumulate(v1.begin(),v1.end(),0ll)));
      v=v1;
     }
     cout<<sum<<endl;
    }
    return 0;

}
Problem: 2062C - Cirno and Operations
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 2):
#include<bits/stdc++.h>
 
using namespace std;
 
#define ll long long
#define mod 1000000007
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)
bool comp(int a,int b){
  return a>b;
}
ll fact(ll n){
  ll x=n; ll prod=1;
  if(n==0) return 1;
  else{
  while(x){
    prod*=x;
    x--;
  }
  return prod;
  }
}
ll C(ll n, ll r){
  return fact(n)/(fact(r)*fact(n-r));
}

int main(){
    fast_io;
    int test=1;
    cin >> test;
    while(test--){
     int n;
     cin>>n;
     vector <int> v(n);
     for(auto &x:v) cin>>x;
     int sum=accumulate(v.begin(),v.end(),0);
     for(int i=1;i<n;i++){
      vector<int> v1(n-i);
      for(int j=0;j<n-i;j++) v1[j]=v[j+1]-v[j];
      sum=max(sum,abs(accumulate(v1.begin(),v1.end(),0)));
      v=v1;
     }
     cout<<sum<<endl;
    }
    return 0;

}

Submission (verdict: Compilation error):
#include<bits/stdc++.h>
 
using namespace std;
 
#define ll long long
#define mod 1000000007
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)
bool comp(int a,int b){
  return a>b;
}
ll fact(ll n){
  ll x=n; ll prod=1;
  if(n==0) return 1;
  else{
  while(x){
    prod*=x;
    x--;
  }
  return prod;
  }
}
ll C(ll n, ll r){
  return fact(n)/(fact(r)*fact(n-r));
}

int main(){
    fast_io;
    int test=1;
    cin >> test;
    while(test--){
     int n;
     cin>>n;
     vector <int> v(n);
     for(auto &x:v) cin>>x;
     ll sum=accumulate(v.begin(),v.end(),0);
     for(int i=1;i<n;i++){
      vector<int> v1(n-i);
      for(int j=0;j<n-i;j++) v1[j]=v[j+1]-v[j];
      sum=max(sum,abs(accumulate(v1.begin(),v1.end(),0)));
      v=v1;
     }
     cout<<sum<<endl;
    }
    return 0;

}
Problem: 2050B - Transfusion
Language: C++23 (GCC 14-64, msys2)


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

const int INF = 1000000000;


void solve () {
    int N;
    cin >> N;
    int arr[N];
    for (int i = 0; i < N; i++) cin >> arr[i];

    int se = 0, so = 0;
    for (int i = 0; i < N; i++) {
        if (!(i % 2)) se += arr[i];
        else so += arr[i];
    }
    if (se % ((N + 1) / 2) == 0 && so % (N / 2) == 0 && se / ((N + 1) / 2) == so / (N / 2)) cout << "YES" << endl;
    else cout << "NO" << endl;
}
 
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    int T;
    cin >> T;
    while (T--) solve();    
}
Problem: 2050B - Transfusion
Language: C++23 (GCC 14-64, msys2)

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

const int INF = 1000000000;


void solve () {
    int N;
    cin >> N;
    int arr[N];
    for (int i = 0; i < N; i++) cin >> arr[i];

    int se = 0, so = 0;
    for (int i = 0; i < N; i++) {
        if (i % 2 == 0) se += arr[i];
        else so += arr[i];
    }

    if (se % ((N + 1) / 2) == 0 && so % (N / 2) == 0 && se / ((N + 1) / 2) == so / (N / 2)) cout << "YES" << endl;
    else cout << "NO" << endl;
}
 
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

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

Submission (verdict: Accepted):
#include <bits/stdc++.h>
using namespace std;

const int INF = 1000000000;


void solve () {
    int N;
    cin >> N;
    int arr[N];
    for (int i = 0; i < N; i++) cin >> arr[i];

    long long se = 0, so = 0;
    for (int i = 0; i < N; i++) {
        if (i % 2 == 0) se += arr[i];
        else so += arr[i];
    }

    if (se % ((N + 1) / 2) == 0 && so % (N / 2) == 0 && se / ((N + 1) / 2) == so / (N / 2)) cout << "YES" << endl;
    else cout << "NO" << endl;
}
 
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    int T;
    cin >> T;
    while (T--) solve();    
}
Problem: 2050B - Transfusion
Language: C++23 (GCC 14-64, msys2)

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

const int INF = 1000000000;


void solve () {
    int N;
    cin >> N;
    int arr[N];
    for (int i = 0; i < N; i++) cin >> arr[i];

    int se = 0, so = 0;
    for (int i = 0; i < N; i++) {
        if (!(i % 2)) se += arr[i];
        else so += arr[i];
    }
    if (se % ((N + 1) / 2) == 0 && so % (N / 2) == 0 && se / ((N + 1) / 2) == so / (N / 2)) cout << "YES" << endl;
    else cout << "NO" << endl;
}
 
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

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

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

const int INF = 1000000000;


void solve () {
    int N;
    cin >> N;
    int arr[N];
    for (int i = 0; i < N; i++) cin >> arr[i];

    int se = 0, so = 0;
    for (int i = 0; i < N; i++) {
        if (i % 2 == 0) se += arr[i];
        else so += arr[i];
    }

    if (se % ((N + 1) / 2) == 0 && so % (N / 2) == 0 && se / ((N + 1) / 2) == so / (N / 2)) cout << "YES" << endl;
    else cout << "NO" << endl;
}
 
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

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