ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2057B - Gorilla and the Exam
Language: C++17 (GCC 7-32)

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

#define endl '\n'
#define ll long long
#define lld long double
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define tc    \
    int t;    \
    cin >> t; \
    while (t--)
#define IOS ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);

void solve()
{
    int n, k;
    cin >> n >> k;
    unordered_map<int, int> m1;
    for (int i = 0; i < n; i++)
    {
        int a;
        cin >> a;
        m1[a]++;
    }
    vector<int> v1;
    for (auto it : m1)
        v1.push_back(it.second);
    sort(v1.begin(), v1.end());
    int i = 0;
    int pp = 0;
    while (i < v1.size() && pp <= k)
        pp += v1[i++];
    cout << v1.size() + 1 - i << endl;
}

int main()
{
    IOS tc
    {
        solve();
    }
}

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

#define endl '\n'
#define ll long long
#define lld long double
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define tc    \
    ll t;     \
    cin >> t; \
    while (t--)
#define IOS ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);

void solve()
{
    ll n, k;
    cin >> n >> k;
    unordered_map<ll, ll> m1;
    for (ll i = 0; i < n; i++)
    {
        ll a;
        cin >> a;
        m1[a]++;
    }
    vector<ll> v1;
    for (auto it : m1)
        v1.push_back(it.second);
    sort(v1.begin(), v1.end());
    ll i = 0;
    ll pp = 0;
    while (i < v1.size() && pp <= k)
        pp += v1[i++];
    cout << v1.size() + 1 - i << endl;
}

int main()
{
    IOS tc
    {
        solve();
    }
}
Problem: 2057B - Gorilla and the Exam
Language: C++17 (GCC 7-32)

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

#define endl '\n'
#define ll long long
#define lld long double
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define tc    \
    int t;    \
    cin >> t; \
    while (t--)
#define IOS ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);

void solve()
{
    int n, k;
    cin >> n >> k;
    unordered_map<int, int> m1;
    for (int i = 0; i < n; i++)
    {
        int a;
        cin >> a;
        m1[a]++;
    }
    vector<int> v1;
    for (auto it : m1)
    {
        v1.push_back(it.second);
    }
    sort(v1.begin(), v1.end());
    // cout << v1[0] << " ";
    for (int i = 1; i < v1.size(); i++)
    {
        // cout << v1[i] << " ";
        v1[i] += v1[i - 1];
    }
    // cout << endl;
    int i = 0;
    while (i < v1.size() && k >= v1[i])
        i++;
    if (i == v1.size())
        cout << 1 << endl;
    else
        cout << v1.size() - i << endl;
}

int main()
{
    IOS tc
    {
        solve();
    }
}

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

#define endl '\n'
#define ll long long
#define lld long double
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define tc    \
    int t;    \
    cin >> t; \
    while (t--)
#define IOS ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);

void solve()
{
    int n, k;
    cin >> n >> k;
    unordered_map<int, int> m1;
    for (int i = 0; i < n; i++)
    {
        int a;
        cin >> a;
        m1[a]++;
    }
    vector<int> v1;
    for (auto it : m1)
        v1.push_back(it.second);
    sort(v1.begin(), v1.end());
    int i = 0;
    int pp = 0;
    while (i < v1.size() && pp <= k)
        pp += v1[i++];
    cout << v1.size() + 1 - i << endl;
}

int main()
{
    IOS tc
    {
        solve();
    }
}
Problem: 2057B - Gorilla and the Exam
Language: C++17 (GCC 7-32)

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

#define endl '\n'
#define ll long long
#define lld long double
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define tc    \
    ll t;     \
    cin >> t; \
    while (t--)
#define IOS ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);

void solve()
{
    ll n, k;
    cin >> n >> k;
    unordered_map<ll, ll> m1;
    for (ll i = 0; i < n; i++)
    {
        ll a;
        cin >> a;
        m1[a]++;
    }
    vector<ll> v1;
    for (auto it : m1)
        v1.push_back(it.second);
    sort(v1.begin(), v1.end());
    ll i = 0;
    ll pp = 0;
    while (i < v1.size() && pp <= k)
        pp += v1[i++];
    cout << v1.size() + 1 - i << endl;
}

int main()
{
    IOS tc
    {
        solve();
    }
}

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

#define endl '\n'
#define ll long long
#define lld long double
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define tc    \
    ll t;     \
    cin >> t; \
    while (t--)
#define IOS ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);

void solve()
{
    ll n, k;
    cin >> n >> k;
    map<ll, ll> m1;
    for (ll i = 0; i < n; i++)
    {
        ll a;
        cin >> a;
        m1[a]++;
    }
    vector<ll> v1;
    for (auto it : m1)
        v1.push_back(it.second);
    sort(v1.begin(), v1.end());
    ll i = 0;
    ll pp = 0;
    while (i < v1.size() && pp <= k)
        pp += v1[i++];
    cout << v1.size() + 1 - i << endl;
}

int main()
{
    IOS tc
    {
        solve();
    }
}
Problem: 2057B - Gorilla and the Exam
Language: C++17 (GCC 7-32)


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

#define endl '\n'
#define ll long long
#define lld long double
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define tc    \
    int t;    \
    cin >> t; \
    while (t--)
#define IOS ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);

void solve()
{
    int n, k;
    cin >> n >> k;
    unordered_map<int, int> m1;
    for (int i = 0; i < n; i++)
    {
        int a;
        cin >> a;
        m1[a]++;
    }
    vector<int> v1;
    for (auto it : m1)
    {
        v1.push_back(it.second);
    }
    sort(v1.begin(), v1.end());
    // cout << v1[0] << " ";
    for (int i = 1; i < v1.size(); i++)
    {
        // cout << v1[i] << " ";
        v1[i] += v1[i - 1];
    }
    // cout << endl;
    int i = 0;
    while (i < n && k >= v1[i])
        i++;
    if (i == n)
        cout << 1 << endl;
    else
        cout << v1.size() - i << endl;
}

int main()
{
    IOS tc
    {
        solve();
    }
}
Problem: 2061D - Kevin and Numbers
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 1):
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <set>
#define ll long long
#define N 200005
using namespace std;
ll i,j,k,m,n,o,p,l,s,t,sum1,sum2,ans,times,bz;
multiset<ll> f,g;
ll a[N],b[N];
int main()
{
    freopen("a.in","r",stdin);
    freopen("a.out","w",stdout);
    scanf("%lld",&times);
    while (times--)
    {
        scanf("%lld%lld",&n,&m);
        if (n==4&m==2)
        {
            int sdfgwse=0;
        }
        f.clear(),g.clear();
        sum1=sum2=0;
        for (i=1;i<=n;i++) scanf("%lld",&a[i]),sum1+=a[i],f.insert(a[i]);
        for (i=1;i<=m;i++) scanf("%lld",&b[i]),sum2+=b[i],g.insert(b[i]);
        if (sum1!=sum2)
        {
            puts("No");
            continue;
        }
        bz=1;
        while ((!f.empty())||(!g.empty()))
        {
            ll x=*f.rbegin(),y=*g.rbegin();
            auto posx=f.find(x),posy=g.find(y);
            if (x==y) 
            {
                f.erase(posx),g.erase(posy);
            }
            else if (x>y)
            {
                bz=0;puts("No");break;
            } else {
                g.erase(posy);
                g.insert(y/2),g.insert((y+1)/2);
            }
        }
        if (bz) puts("Yes");
        else puts("No");
    }
    return 0;
}
Problem: 2061D - Kevin and Numbers
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 1):
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <set>
#define ll long long
#define N 200005
using namespace std;
ll i,j,k,m,n,o,p,l,s,t,sum1,sum2,ans,times,bz;
multiset<ll> f,g;
ll a[N],b[N];
int main()
{
    freopen("a.in","r",stdin);
    freopen("a.out","w",stdout);
    scanf("%lld",&times);
    while (times--)
    {
        scanf("%lld%lld",&n,&m);
        if (n==4&m==2)
        {
            int sdfgwse=0;
        }
        f.clear(),g.clear();
        sum1=sum2=0;
        for (i=1;i<=n;i++) scanf("%lld",&a[i]),sum1+=a[i],f.insert(a[i]);
        for (i=1;i<=m;i++) scanf("%lld",&b[i]),sum2+=b[i],g.insert(b[i]);
        if (sum1!=sum2)
        {
            puts("No");
            continue;
        }
        bz=1;
        while ((!f.empty())||(!g.empty()))
        {
            ll x=*f.rbegin(),y=*g.rbegin();
            auto posx=f.find(x),posy=g.find(y);
            if (x==y) 
            {
                f.erase(posx),g.erase(posy);
            }
            else if (x>y)
            {
                bz=0;puts("No");break;
            } else {
                g.erase(posy);
                g.insert(y/2),g.insert((y+1)/2);
            }
        }
        if (bz) puts("Yes");
        else puts("No");
    }
    return 0;
}

Submission (verdict: Wrong answer on test 1):
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <set>
#define ll long long
#define N 200005
using namespace std;
ll i,j,k,m,n,o,p,l,s,t,sum1,sum2,ans,times,bz;
multiset<ll> f,g;
ll a[N],b[N];
int main()
{
    //freopen("a.in","r",stdin);
    //freopen("a.out","w",stdout);
    scanf("%lld",&times);
    while (times--)
    {
        scanf("%lld%lld",&n,&m);
        if (n==4&m==2)
        {
            int sdfgwse=0;
        }
        f.clear(),g.clear();
        sum1=sum2=0;
        for (i=1;i<=n;i++) scanf("%lld",&a[i]),sum1+=a[i],f.insert(a[i]);
        for (i=1;i<=m;i++) scanf("%lld",&b[i]),sum2+=b[i],g.insert(b[i]);
        if (sum1!=sum2)
        {
            puts("No");
            continue;
        }
        bz=1;
        while ((!f.empty())||(!g.empty()))
        {
            ll x=*f.rbegin(),y=*g.rbegin();
            auto posx=f.find(x),posy=g.find(y);
            if (x==y) 
            {
                f.erase(posx),g.erase(posy);
            }
            else if (x>y)
            {
                bz=0;puts("No");break;
            } else {
                g.erase(posy);
                g.insert(y/2),g.insert((y+1)/2);
            }
        }
        if (bz) puts("Yes");
        else puts("No");
    }
    return 0;
}
Problem: 2061D - Kevin and Numbers
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 1):
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <set>
#define ll long long
#define N 200005
using namespace std;
ll i,j,k,m,n,o,p,l,s,t,sum1,sum2,ans,times,bz;
multiset<ll> f,g;
ll a[N],b[N];
int main()
{
    //freopen("a.in","r",stdin);
    //freopen("a.out","w",stdout);
    scanf("%lld",&times);
    while (times--)
    {
        scanf("%lld%lld",&n,&m);
        if (n==4&m==2)
        {
            int sdfgwse=0;
        }
        f.clear(),g.clear();
        sum1=sum2=0;
        for (i=1;i<=n;i++) scanf("%lld",&a[i]),sum1+=a[i],f.insert(a[i]);
        for (i=1;i<=m;i++) scanf("%lld",&b[i]),sum2+=b[i],g.insert(b[i]);
        if (sum1!=sum2)
        {
            puts("No");
            continue;
        }
        bz=1;
        while ((!f.empty())||(!g.empty()))
        {
            ll x=*f.rbegin(),y=*g.rbegin();
            auto posx=f.find(x),posy=g.find(y);
            if (x==y) 
            {
                f.erase(posx),g.erase(posy);
            }
            else if (x>y)
            {
                bz=0;puts("No");break;
            } else {
                g.erase(posy);
                g.insert(y/2),g.insert((y+1)/2);
            }
        }
        if (bz) puts("Yes");
        else puts("No");
    }
    return 0;
}

Submission (verdict: Accepted):
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <set>
#define ll long long
#define N 200005
using namespace std;
ll i,j,k,m,n,o,p,l,s,t,sum1,sum2,ans,times,bz;
multiset<ll> f,g;
ll a[N],b[N];
int main()
{
   // freopen("a.in","r",stdin);
 //   freopen("a.out","w",stdout);
    scanf("%lld",&times);
    while (times--)
    {
        scanf("%lld%lld",&n,&m);
        bz=1;
        f.clear(),g.clear();
        sum1=sum2=0;
        for (i=1;i<=n;i++) scanf("%lld",&a[i]),sum1+=a[i],f.insert(a[i]);
        for (i=1;i<=m;i++) scanf("%lld",&b[i]),sum2+=b[i],g.insert(b[i]);
        if (sum1!=sum2)
        {
            puts("No");
            continue;
        }
        while ((!f.empty())||(!g.empty()))
        {
            ll x=*f.rbegin(),y=*g.rbegin();
            auto posx=f.find(x),posy=g.find(y);
            if (x==y) 
            {
                f.erase(posx),g.erase(posy);
            }
            else if (x>y)
            {
                bz=0;break;
            } else {
                g.erase(posy);
                g.insert(y/2),g.insert((y+1)/2);
            }
        }
        if (bz) puts("Yes");
        else puts("No");
    }
    return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 2):
#include<bits/stdc++.h>
using namespace std;
int main()
{int t;
    cin>>t;
    while(t--)
    {int le[31];
        int re[31];
        int third[31];
        for(int i=0;i<31;i=i+1)le[i]=re[i]=third[i]=0;
        int l,r;
    cin>>l>>r;
    int i=30;
    int point;
    for(int j=l;j>0;j=j/2){le[i]=j%2;i--;}
    i=30;
    for(int j=r;j>0;j=j/2){re[i]=j%2;i--;}
    for(int k=0;k<31;k=k+1){if(le[k]!=re[k]){point=k;break;}else third[k]=le[k];}
    int careful=0;
    for(int k=point;k<31;k=k+1)
    {if(careful==0){if(re[k]==1 && le[k]==0)third[k]=0;
      else  if(re[k]==0 && le[k]==0){third[k]=1;careful=1;}
      else if(re[k]==0 && le[k]==1)third[k]=1;
      else if(re[k]==1 && le[k]==1){re[k]=0;third[k]=1;}}
      else{
        if(re[k]==0)third[k]=1;
        else third[k]=0;
      }}
      long long int num1,num2;
      int v=0;
      for(int i=0;i<31;i=i+1)if(v==0){if(re[i]==0)num1=0;else {num1=1;v=1;}}
      else {
        if(re[i]==0)num1*=2;else num1=num1*2+1;
      }
       v=0;
      for(int i=0;i<31;i=i+1)if(v==0){if(third[i]==0)num2=0;else {num2=1;v=1;}}
      else {
        if(third[i]==0)num2*=2;else num2=num2*2+1;
      }
cout<<num1<<' '<<num2<<' ';
for(int k=l;k<=r;k=k+1)if(k!=num1 && k!=num2){cout<<k<<endl;break;}
}}

Submission (verdict: Accepted):
t=int(input())
for x in range(0,t):
   l,m=list(map(int,input().split()))
   import math
   i=math.log2(m)
   j=0
   if l>0:
   
      j=math.log2(l)
   
   if m==2:
         a=0
         b=1
         c=2
         print(a,b,c)
   
   elif m-l<=4:
      a=l
      b=m-1
      c=m
      print(a,b,c)
   elif m-l>4:
      a=0
      
         
      b=[]
      
      y=[]
      z=[]
      h=[]
      k=0
      
      p=m
      n=l
      for x in range(int(i),-1,-1):
      
         if p>=2**x:
            y.append(1)
            p-=2**x
         else:y.append(0)
      for t in range(int(j),-1,-1):
      
         if n>=2**t:
            z.append(1)
            n-=2**t
         else:
            z.append(0)
      if len(y)==len(z):
         h=z
      
      elif len(y)>len(z):
         for i in range(0,(len(y)-len(z))):
            h.append(0)
         for i in range(0,len(z)):
            h.append(z[i])
      
      if h.index(0)==0:
      
         b.append(0)
         
         for i in range(1,len(y)):
            if y[i]==1:
               b.append(0)
            elif y[i]==0:
               b.append(1)
   
      elif h.index(0)>0: 
         for i in range(0,(z.index(0))):
         
            b.append(1)
         for j in range(i+1,y.index(1)):
            b.append(0)
         b.append(1)
      
      
         for k in range(len(b),len(y)):
            if y[k]==1 and z[k]==1:
               b.append(0)
            elif y[k]==0 and z[k]==0:
               b.append(1)
            elif y[k]==1 and z[k]==0:
               b.append(0)
      for i in range(0,len(b)):
            
         k+=b[i]*(2**(len(b)-i-1))
            
      h=l   
      y=m
      if k<=l:
   
        k=l+1
      elif k>=m:       
         k=m-1
      
                 
      print(y,k,h)
Problem: 2057C - Trip to the Olympiad
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 1):
#include<bits/stdc++.h>
using namespace std;
int main()
{int t;
    cin>>t;
    while(t--)
    {int le[31];
        int re[31];
        int third[31];
        for(int i=0;i<31;i=i+1)le[i]=re[i]=third[i]=0;
        int l,r;
    cin>>l>>r;
    int i=30;
    int point;
    for(int j=l;j>0;j=j/2){le[i]=j%2;i--;}
    i=30;
    for(int j=r;j>0;j=j/2){re[i]=j%2;i--;}
    for(int k=0;k<31;k=k+1){if(le[k]!=re[k]){point=k;break;}else third[k]=le[k];}
    int careful=0;
    for(int k=point;k<31;k=k+1)
    {if(careful==0){if(re[k]==1 && le[k]==0)third[k]=0;
      else  if(re[k]==0 && le[i]==0){third[k]=1;careful=1;}
      else if(re[k]==0 && le[k]==1)third[k]=1;
      else if(re[k]==1 && le[k]==1){re[k]=0;third[k]=1;}}
      else{
        if(re[k]==0)third[k]=1;
        else third[k]=0;
      }}
      long long int num1,num2;
      int v=0;
      for(int i=0;i<31;i=i+1)if(v==0){if(re[i]==0)num1=0;else {num1=1;v=1;}}
      else {
        if(re[i]==0)num1*=2;else num1=num1*2+1;
      }
       v=0;
      for(int i=0;i<31;i=i+1)if(v==0){if(third[i]==0)num2=0;else {num2=1;v=1;}}
      else {
        if(third[i]==0)num2*=2;else num2=num2*2+1;
      }
cout<<num1<<' '<<num2<<' ';
for(int k=l;k<=r;k=k+1)if(k!=num1 && k!=num2){cout<<k<<endl;break;}
}}

Submission (verdict: Wrong answer on test 2):
#include<bits/stdc++.h>
using namespace std;
int main()
{int t;
    cin>>t;
    while(t--)
    {int le[31];
        int re[31];
        int third[31];
        for(int i=0;i<31;i=i+1)le[i]=re[i]=third[i]=0;
        int l,r;
    cin>>l>>r;
    int i=30;
    int point;
    for(int j=l;j>0;j=j/2){le[i]=j%2;i--;}
    i=30;
    for(int j=r;j>0;j=j/2){re[i]=j%2;i--;}
    for(int k=0;k<31;k=k+1){if(le[k]!=re[k]){point=k;break;}else third[k]=le[k];}
    int careful=0;
    for(int k=point;k<31;k=k+1)
    {if(careful==0){if(re[k]==1 && le[k]==0)third[k]=0;
      else  if(re[k]==0 && le[k]==0){third[k]=1;careful=1;}
      else if(re[k]==0 && le[k]==1)third[k]=1;
      else if(re[k]==1 && le[k]==1){re[k]=0;third[k]=1;}}
      else{
        if(re[k]==0)third[k]=1;
        else third[k]=0;
      }}
      long long int num1,num2;
      int v=0;
      for(int i=0;i<31;i=i+1)if(v==0){if(re[i]==0)num1=0;else {num1=1;v=1;}}
      else {
        if(re[i]==0)num1*=2;else num1=num1*2+1;
      }
       v=0;
      for(int i=0;i<31;i=i+1)if(v==0){if(third[i]==0)num2=0;else {num2=1;v=1;}}
      else {
        if(third[i]==0)num2*=2;else num2=num2*2+1;
      }
cout<<num1<<' '<<num2<<' ';
for(int k=l;k<=r;k=k+1)if(k!=num1 && k!=num2){cout<<k<<endl;break;}
}}
Problem: 2062C - Cirno and Operations
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 1):
#include<bits/stdc++.h>
using namespace std;
int main()
{int t;
    cin>>t;
    while(t--){
    int n;
    cin>>n;
    int t=n;
    long long unsigned int arr[n];
    long long unsigned ans=INT_MIN;
    long long unsigned int sum=0;
    for(int i=0;i<n;i=i+1){cin>>arr[i];sum=sum+arr[i];}
    if(sum>ans)ans=sum;
    for(int k=0;k<n-1;k=k+1){sum=0;
    for(int i=0;i<t-1;i=i+1){arr[i]=arr[i+1]-arr[i];sum=sum+arr[i];}
    if(sum<0)sum=-1*sum;else sum=sum;
    if(sum>ans)ans=sum;t--;}
    cout<<ans<<endl;}}




Submission (verdict: Accepted):
#include<bits/stdc++.h>
using namespace std;
int main()
{int t;
    cin>>t;
    while(t--){
    int n;
    cin>>n;
    int t=n;
    long long  int arr[n];
    long long  ans=INT_MIN;
    long long int sum=0;
    for(int i=0;i<n;i=i+1){cin>>arr[i];sum=sum+arr[i];}
    if(sum>ans)ans=sum;
    for(int k=0;k<n-1;k=k+1){sum=0;
    for(int i=0;i<t-1;i=i+1){arr[i]=arr[i+1]-arr[i];sum=sum+arr[i];}
    if(sum<0)sum=-1*sum;else sum=sum;
    if(sum>ans)ans=sum;t--;}
    cout<<ans<<endl;}}
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;
int main()
{int t;
    cin>>t;
    while(t--){
    int n;
    cin>>n;
    int t=n;
    int arr[n];
    int ans=INT_MIN;
    int sum=0;
    for(int i=0;i<n;i=i+1){cin>>arr[i];sum=sum+arr[i];}
    if(sum>ans)ans=sum;
    for(int k=0;k<n-1;k=k+1){sum=0;
    for(int i=0;i<t-1;i=i+1){arr[i]=arr[i+1]-arr[i];sum=sum+arr[i];}
    if(sum<0)sum=-1*sum;else sum=sum;
    if(sum>ans)ans=sum;t--;}
    cout<<ans<<endl;}}


Submission (verdict: Wrong answer on test 2):
#include<bits/stdc++.h>
using namespace std;
int main()
{int t;
    cin>>t;
    while(t--){
    int n;
    cin>>n;
    int t=n;
    int arr[n];
    long long  ans=INT_MIN;
    long long int sum=0;
    for(int i=0;i<n;i=i+1){cin>>arr[i];sum=sum+arr[i];}
    if(sum>ans)ans=sum;
    for(int k=0;k<n-1;k=k+1){sum=0;
    for(int i=0;i<t-1;i=i+1){arr[i]=arr[i+1]-arr[i];sum=sum+arr[i];}
    if(sum<0)sum=-1*sum;else sum=sum;
    if(sum>ans)ans=sum;t--;}
    cout<<ans<<endl;}}
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;
int main()
{int t;
    cin>>t;
    while(t--){
    int n;
    cin>>n;
    int t=n;
    int arr[n];
    long long  ans=INT_MIN;
    long long int sum=0;
    for(int i=0;i<n;i=i+1){cin>>arr[i];sum=sum+arr[i];}
    if(sum>ans)ans=sum;
    for(int k=0;k<n-1;k=k+1){sum=0;
    for(int i=0;i<t-1;i=i+1){arr[i]=arr[i+1]-arr[i];sum=sum+arr[i];}
    if(sum<0)sum=-1*sum;else sum=sum;
    if(sum>ans)ans=sum;t--;}
    cout<<ans<<endl;}}


Submission (verdict: Wrong answer on test 1):
#include<bits/stdc++.h>
using namespace std;
int main()
{int t;
    cin>>t;
    while(t--){
    int n;
    cin>>n;
    int t=n;
    long long unsigned int arr[n];
    long long unsigned ans=INT_MIN;
    long long unsigned int sum=0;
    for(int i=0;i<n;i=i+1){cin>>arr[i];sum=sum+arr[i];}
    if(sum>ans)ans=sum;
    for(int k=0;k<n-1;k=k+1){sum=0;
    for(int i=0;i<t-1;i=i+1){arr[i]=arr[i+1]-arr[i];sum=sum+arr[i];}
    if(sum<0)sum=-1*sum;else sum=sum;
    if(sum>ans)ans=sum;t--;}
    cout<<ans<<endl;}}
Problem: 2062C - Cirno and Operations
Language: C++23 (GCC 14-64, msys2)


Submission (verdict: Wrong answer on test 2):
#include<bits/stdc++.h>
using namespace std;
int main()
{int t;
    cin>>t;
    while(t--){
    int n;
    cin>>n;
    int t=n;
    int arr[n];
    int ans=INT_MIN;
    int sum=0;
    for(int i=0;i<n;i=i+1){cin>>arr[i];sum=sum+arr[i];}
    if(sum>ans)ans=sum;
    for(int k=0;k<n-1;k=k+1){sum=0;
    for(int i=0;i<t-1;i=i+1){arr[i]=arr[i+1]-arr[i];sum=sum+arr[i];}
    if(sum<0)sum=-1*sum;else sum=sum;
    if(sum>ans)ans=sum;t--;}
    cout<<ans<<endl;}}
Problem: 2050B - Transfusion
Language: C++17 (GCC 7-32)


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

using namespace std;

int main() {

    int t;

    cin>>t;

    while(t--){

        int n,oddsm=0,evensm=0,oddcnt=0,evencnt=0;

        cin>>n;

        int arr[n];

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

            cin>>arr[i];

            if(i%2==0){

                evensm+=arr[i];

                evencnt++;

            }

            else{

                oddsm+=arr[i];

                oddcnt++;

            }

        }

        if(evensm%evencnt!=0 || oddsm%oddcnt !=0 || evensm/evencnt!=oddsm/oddcnt)

            cout<<"NO\n";

        else cout<<"YES\n";

    }

    return 0;

}