ShaysXIA/CodeInsightBench huggingface dataset:
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;

#pragma GCC target("popcnt")
using ll = long long;
#define int long long
using pii = pair<int, int>;

constexpr int INF = 4e18 + 10;
constexpr int MOD = 998244353;
constexpr int MAXN = 1e3 + 5;

int a[MAXN], cur[MAXN], pos[MAXN];
bool vis[MAXN][MAXN];

void solve(){
    int n; cin >> n;
    for (int i = 1; i <= n; i++){
        cin >> a[i];

        cur[i] = i;
        pos[i] = i;
    }

    vector<pii> res;
    for (int i = 1; i <= n; i++){
        int ptr = pos[a[i]];
        while(ptr >= 1 && a[ptr] != cur[ptr]){
            res.push_back({cur[ptr], cur[ptr - 1]});
            vis[cur[ptr]][cur[ptr - 1]] = 1;

            swap(cur[ptr], cur[ptr - 1]);
            pos[cur[ptr]] = ptr;
            pos[cur[ptr - 1]] = ptr - 1;
            --ptr;
        }
    }

    for (int i = 1; i < n; i++){
        if (!vis[cur[i]][cur[i + 1]] && !vis[cur[i + 1]][cur[i]]){
            res.push_back({ cur[i + 1], cur[i]});
            res.push_back({cur[i], cur[i + 1]});
        }
    }

    cout << res.size() << "\n";
    for (auto &it : res)
        cout << it.first << " " << it.second << "\n";
}

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int numTests = 1;
    // cin >> numTests;
    while(numTests-- ){
        solve();
    }
    return 0;
}

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

#pragma GCC target("popcnt")
using ll = long long;
#define int long long
using pii = pair<int, int>;

constexpr int INF = 4e18 + 10;
constexpr int MOD = 998244353;
constexpr int MAXN = 1e3 + 5;

int a[MAXN], cur[MAXN], pos[MAXN];

void solve(){
    int n; cin >> n;
    for (int i = 1; i <= n; i++){
        cin >> a[i];

        cur[i] = i;
        pos[i] = i;
    }

    vector<pii> res, res2;
    for (int i = 1; i <= n; i++){
        int ptr = pos[a[i]];
        while(ptr >= 1 && a[ptr] != cur[ptr]){
            res.push_back({cur[ptr], cur[ptr - 1]});

            swap(cur[ptr], cur[ptr - 1]);
            pos[cur[ptr]] = ptr;
            pos[cur[ptr - 1]] = ptr - 1;
            --ptr;
        }
    }

    for (int i = n; i >= 1; i--){
        while(pos[i] != 1 && cur[pos[i] - 1] < i){
            res2.push_back({i, cur[pos[i] - 1]});
            swap(cur[pos[i] - 1], cur[pos[i]]);
            pos[cur[pos[i]]] = pos[i];
            pos[cur[pos[i] - 1]] = pos[i] - 1;
        }
    }

    cout << res.size() + res2.size() * 2 << "\n";
    for (auto &it : res)
        cout << it.first << " " << it.second << "\n";
    for (auto &it : res2)
        cout << it.first << " " << it.second << "\n";
    for (int i = res2.size() - 1; i >= 0; i--)
        cout << res2[i].second << " " << res2[i].first << "\n";

}

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

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

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

#pragma GCC target("popcnt")
using ll = long long;
#define int long long
using pii = pair<int, int>;

constexpr int INF = 4e18 + 10;
constexpr int MOD = 998244353;
constexpr int MAXN = 1e3 + 5;

int a[MAXN], cur[MAXN], pos[MAXN];
bool vis[MAXN][MAXN];

void solve(){
    int n; cin >> n;
    for (int i = 1; i <= n; i++){
        cin >> a[i];

        cur[i] = i;
        pos[i] = i;
    }

    vector<pii> res;
    for (int i = 1; i <= n; i++){
        int ptr = pos[a[i]];
        while(ptr >= 1 && a[ptr] != cur[ptr]){
            res.push_back({cur[ptr], cur[ptr - 1]});
            vis[cur[ptr]][cur[ptr - 1]] = 1;

            swap(cur[ptr], cur[ptr - 1]);
            pos[cur[ptr]] = ptr;
            pos[cur[ptr - 1]] = ptr - 1;
            --ptr;
        }
    }

    for (int i = 1; i <= n; i++){
        for (int j = i + 1; j <= n; j++){
            if (!vis[i][j] && !vis[j][i]){
                res.push_back({i, j});
                res.push_back({j, i});
            }
        }
    }

    cout << res.size() << "\n";
    for (auto &it : res)
        cout << it.first << " " << it.second << "\n";
}

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int numTests = 1;
    // cin >> numTests;
    while(numTests-- ){
        solve();
    }
    return 0;
}

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

#pragma GCC target("popcnt")
using ll = long long;
#define int long long
using pii = pair<int, int>;

constexpr int INF = 4e18 + 10;
constexpr int MOD = 998244353;
constexpr int MAXN = 1e3 + 5;

int a[MAXN], cur[MAXN], pos[MAXN];
bool vis[MAXN][MAXN];

void solve(){
    int n; cin >> n;
    for (int i = 1; i <= n; i++){
        cin >> a[i];

        cur[i] = i;
        pos[i] = i;
    }

    vector<pii> res;
    for (int i = 1; i <= n; i++){
        int ptr = pos[a[i]];
        while(ptr >= 1 && a[ptr] != cur[ptr]){
            res.push_back({cur[ptr], cur[ptr - 1]});
            vis[cur[ptr]][cur[ptr - 1]] = 1;

            swap(cur[ptr], cur[ptr - 1]);
            pos[cur[ptr]] = ptr;
            pos[cur[ptr - 1]] = ptr - 1;
            --ptr;
        }
    }

    for (int i = 1; i < n; i++){
        if (!vis[cur[i]][cur[i + 1]] && !vis[cur[i + 1]][cur[i]]){
            res.push_back({ cur[i + 1], cur[i]});
            res.push_back({cur[i], cur[i + 1]});
        }
    }

    cout << res.size() << "\n";
    for (auto &it : res)
        cout << it.first << " " << it.second << "\n";
}

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int numTests = 1;
    // cin >> numTests;
    while(numTests-- ){
        solve();
    }
    return 0;
}
Problem: 2063B - Subsequence Update
Language: C++17 (GCC 7-32)

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

using namespace std;

using ll=long long;



void test_case() {

  int n, l, r;

  cin >> n >> l >> r;

  vector<int> a(n);

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



  sort(a.begin(), a.end());

  int k = r-l+1;

  int s = 0;

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

    s += a[i];

  }

  cout << s << endl;

}



int32_t main(){

  ios_base::sync_with_stdio(0); cin.tie(0);



  int t;

  cin >> t;

  while (t--){

    test_case();    

  }

}

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

void test_case() {
  ll n, l, r;
  cin >> n >> l >> r;
  vector<ll> a(n);
  vector<ll> b(n);
  for (int i=0;i<n;i++) {
    cin >> a[i];
    b[i] = a[i];
  }

  l--; r--;
  sort(a.begin()+l, a.end());
  sort(b.begin(), b.begin()+r);
  ll k = r-l+1;
  ll s1 = 0;
  for (int i=l;i<l+k;i++) {
    s1 += a[i];
  }
  ll s2 = 0;
  for (int i=0;i<k;i++) {
    s2 += b[i];
  }
  cout << min(s1, s2) << endl;
}

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

  int t;
  cin >> t;
  while (t--){
    test_case();
  }
}
Problem: 2063B - Subsequence Update
Language: C++17 (GCC 7-32)

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

void test_case() {
  ll n, l, r;
  cin >> n >> l >> r;
  vector<ll> a(n);
  vector<ll> b(n);
  for (int i=0;i<n;i++) {
    cin >> a[i];
    b[i] = a[i];
  }

  l--; r--;
  sort(a.begin()+l, a.end());
  sort(b.begin(), b.begin()+r);
  ll k = r-l+1;
  ll s1 = 0;
  for (int i=l;i<l+k;i++) {
    s1 += a[i];
  }
  ll s2 = 0;
  for (int i=0;i<k;i++) {
    s2 += b[i];
  }
  cout << min(s1, s2) << endl;
}

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

  int t;
  cin >> t;
  while (t--){
    test_case();
  }
}

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

using namespace std;

using ll=long long;



void test_case() {

  ll n, l, r;

  cin >> n >> l >> r;

  vector<ll> a(n);

  vector<ll> b(n);

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

    cin >> a[i];

    b[i] = a[i];

  }



  l--; r--;

  sort(a.begin()+l, a.end());

  sort(b.begin(), b.begin()+r);

  reverse(b.begin(), b.begin()+r);



  ll k = r-l+1;

  ll s1 = 0;

  for (int i=l;i<l+k;i++) {

    s1 += a[i];

  }

  ll s2 = 0;

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

    s2 += b[i];

  }

  cout << min(s1, s2) << endl;

}



int32_t main(){

  ios_base::sync_with_stdio(0); cin.tie(0);



  int t;

  cin >> t;

  while (t--){

    test_case();

  }

}
Problem: 2063B - Subsequence Update
Language: C++17 (GCC 7-32)


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

using namespace std;

using ll=long long;



void test_case() {

  int n, l, r;

  cin >> n >> l >> r;

  vector<int> a(n);

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



  sort(a.begin(), a.end());

  int k = r-l+1;

  int s = 0;

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

    s += a[i];

  }

  cout << s << endl;

}



int32_t main(){

  ios_base::sync_with_stdio(0); cin.tie(0);



  int t;

  cin >> t;

  while (t--){

    test_case();    

  }

}
Problem: 2063B - Subsequence Update
Language: C++17 (GCC 7-32)

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

using namespace std;

using ll=long long;



void test_case() {

  ll n, l, r;

  cin >> n >> l >> r;

  vector<ll> a(n);

  vector<ll> b(n);

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

    cin >> a[i];

    b[i] = a[i];

  }



  l--; r--;

  sort(a.begin()+l, a.end());

  sort(b.begin(), b.begin()+r);

  reverse(b.begin(), b.begin()+r);



  ll k = r-l+1;

  ll s1 = 0;

  for (int i=l;i<l+k;i++) {

    s1 += a[i];

  }

  ll s2 = 0;

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

    s2 += b[i];

  }

  cout << min(s1, s2) << endl;

}



int32_t main(){

  ios_base::sync_with_stdio(0); cin.tie(0);



  int t;

  cin >> t;

  while (t--){

    test_case();

  }

}

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

void test_case() {
  ll n, l, r;
  cin >> n >> l >> r;
  vector<ll> a(n);
  vector<ll> b(n);
  for (int i=0;i<n;i++) {
    cin >> a[i];
    b[i] = a[i];
  }

  l--; 
  sort(a.begin()+l, a.end());
  sort(b.begin(), b.begin()+r);
  reverse(b.begin(), b.begin()+r);

  ll k = r-l+1;
  ll s1 = 0, s2 = 0;
  for (int i=l;i<r;i++) {
    s1 += a[i];
    s2 += b[i];
  }

  cout << min(s1, s2) << endl;
}

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

  int t;
  cin >> t;
  while (t--){
    test_case();
  }
}
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;

int main(){
    int t;
    cin >> t;
    while(t--){
      int n;
        cin >> n;
        int a[n];
        vector<int>v;
        int ans = 0;
        for(int i=0;i<n;i++){
            cin >> a[i];
            ans+=a[i];
            v.push_back(a[i]);
        }
        vector<int>curr;
        while(v.size()>1){
            
            int sum = 0;
            for(int i=1;i<v.size();i++){
               curr.push_back(v[i]-v[i-1]);
                sum+=(v[i]-v[i-1]);
            }
            
            v.clear();
            v = curr;
            curr.clear();
            ans = max(ans, abs(sum));
        }
        cout << ans << endl;
    }
}



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

int main(){
    int t;
    cin >> t;
    while(t--){
      long long n;
        cin >> n;
        long long a[n];
        vector<long long int>v;
        long long ans = 0;
        for(int i=0;i<n;i++){
            cin >> a[i];
            ans+=a[i];
            v.push_back(a[i]);
        }
        vector<long long int>curr;
        while(v.size()>1){
            
            long long  sum = 0;
            for(int i=1;i<v.size();i++){
               curr.push_back(v[i]-v[i-1]);
                sum+=(v[i]-v[i-1]);
            }
            
            v.clear();
            v = curr;
            curr.clear();
            ans = max(ans, abs(sum));
        }
        cout << ans << endl;
    }
}
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;

int main(){
    int t;
    cin >> t;
    while(t--){
      int n;
        cin >> n;
        int a[n];
        vector<int>v;
        int ans = 0;
        for(int i=0;i<n;i++){
            cin >> a[i];
            ans+=a[i];
            v.push_back(a[i]);
        }
        vector<int>curr;
        while(v.size()>1){
            
            int sum = 0;
            for(int i=1;i<v.size();i++){
               curr.push_back(v[i]-v[i-1]);
                sum+=(v[i]-v[i-1]);
            }
            int nSum = -1*sum;
            if(nSum > sum){
                for(int i=0;i<curr.size();i++){
                    curr[i] = -1*curr[i];
                }
            }
            v.clear();
            
            v = curr;
            curr.clear();
        }
        cout << max(ans,v[0]) << 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 a[n];
        vector<int>v;
        int ans = 0;
        for(int i=0;i<n;i++){
            cin >> a[i];
            ans+=a[i];
            v.push_back(a[i]);
        }
        vector<int>curr;
        while(v.size()>1){
            
            int sum = 0;
            for(int i=1;i<v.size();i++){
               curr.push_back(v[i]-v[i-1]);
                sum+=(v[i]-v[i-1]);
            }
            
            v.clear();
            v = curr;
            curr.clear();
            ans = max(ans, abs(sum));
        }
        cout << ans << endl;
    }
}
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;

int main(){
    int t;
    cin >> t;
    while(t--){
      int n;
        cin >> n;
        int a[n];
        vector<int>v;
        int ans = 0;
        for(int i=0;i<n;i++){
            cin >> a[i];
            ans+=a[i];
            v.push_back(a[i]);
        }
        vector<int>curr;
        while(v.size()>1){
            
            int sum = 0;
            for(int i=1;i<v.size();i++){
               curr.push_back(v[i]-v[i-1]);
                sum+=(v[i]-v[i-1]);
            }
            int nSum = -1*sum;
            if(nSum > sum){
                for(int i=0;i<curr.size();i++){
                    curr[i] = -1*curr[i];
                }
            }
            v.clear();
            
            v = curr;
            curr.clear();
        }
        cout << max(ans,v[0]) << endl;
    }
}
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>
#include<iostream>
#include<vector>
using ll=long long;
ll mod=1000000007;
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
ll gcd(ll a, ll b){if (b == 0)return a;return gcd(b, a % b);}
ll lcm(ll a, ll b){return ((a/gcd(a,b))*b);}
bool isPrime(int n){if(n<=1)return false;if(n<=3)return true;if(n%2==0||n%3==0)return false;for(int i=5;i*i<=n;i=i+6)if(n%i==0||n%(i+2)==0)return false;return true;}
long long fact(long long n){
    ll val=1;
    for(int i=1;i<=n;i++)val=(val*i)%mod;
    return val; }
#define pi 3.141592653589793238
#define N cout<<"NO"<<endl; 
#define Y cout<<"YES"<<endl; 
using namespace std;

int main(){
ll t;cin>>t;
while(t--){
    ll l,r;cin>>l>>r;
    ll cnt=0;
    while(r!=0){
        r/=2;
        cnt++;
    }
    cnt--;
    ll el=pow(2,cnt);
    if(el-2>=l)
    cout<<el<<" "<<el-1<<" "<<el-2<<endl;
    else if(el-1==l)
    cout<<el<<" "<<el-1<<" "<<el+1<<endl;
    else {
        cout<<el<<" "<<el+1<<" "<<el+2<<endl;
    }
}
return 0;
}


Submission (verdict: Accepted):
#include<bits/stdc++.h>
#include<iostream>
#include<vector>
using ll=long long;
ll mod=1000000007;
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
ll gcd(ll a, ll b){if (b == 0)return a;return gcd(b, a % b);}
ll lcm(ll a, ll b){return ((a/gcd(a,b))*b);}
bool isPrime(int n){if(n<=1)return false;if(n<=3)return true;if(n%2==0||n%3==0)return false;for(int i=5;i*i<=n;i=i+6)if(n%i==0||n%(i+2)==0)return false;return true;}
long long fact(long long n){
    ll val=1;
    for(int i=1;i<=n;i++)val=(val*i)%mod;
    return val; }
#define pi 3.141592653589793238
#define N cout<<"NO"<<endl; 
#define Y cout<<"YES"<<endl; 
using namespace std;

int main(){
ll t;cin>>t;
while(t--){
   ll l, r;
    cin >> l >> r;
    ll ans = 0;
    ll a, b, c;
    for (int i = 30; i >= 0; i--)
    {
        ll b1 = 0;
        ll b2 = 0;
        if (l & (1ll << i))
        {
            b1 = 1;
        }
        if (r & (1ll << i))
        {
            b2 = 1;
        }
        if (b1 == b2)
        {
            ans += b1 * (1ll << i);
        }
        else
        {
            a = ans + (1ll << i);
            b = a - 1;
            break;
        }
    }
    for (ll i = l; i <= r; i++)
    {
        if (i != a && i != b)
        {
            c = i;
            break;
        }
    }
    cout << a << " " << b << " " << c << endl;
}
return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++23 (GCC 14-64, msys2)


Submission (verdict: Wrong answer on test 1):
#include<bits/stdc++.h>
#include<iostream>
#include<vector>
using ll=long long;
ll mod=1000000007;
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
ll gcd(ll a, ll b){if (b == 0)return a;return gcd(b, a % b);}
ll lcm(ll a, ll b){return ((a/gcd(a,b))*b);}
bool isPrime(int n){if(n<=1)return false;if(n<=3)return true;if(n%2==0||n%3==0)return false;for(int i=5;i*i<=n;i=i+6)if(n%i==0||n%(i+2)==0)return false;return true;}
long long fact(long long n){
    ll val=1;
    for(int i=1;i<=n;i++)val=(val*i)%mod;
    return val; }
#define pi 3.141592653589793238
#define N cout<<"NO"<<endl; 
#define Y cout<<"YES"<<endl; 
using namespace std;

int main(){
ll t;cin>>t;
while(t--){
    ll l,r;cin>>l>>r;
    ll cnt=0;
    while(r!=0){
        r/=2;
        cnt++;
    }
    cnt--;
    ll el=pow(2,cnt);
    cout<<el<<" "<<el-1<<" "<<el-2<<endl;
}
return 0;
}
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>
#include<iostream>
#include<vector>
using ll=long long;
ll mod=1000000007;
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
ll gcd(ll a, ll b){if (b == 0)return a;return gcd(b, a % b);}
ll lcm(ll a, ll b){return ((a/gcd(a,b))*b);}
bool isPrime(int n){if(n<=1)return false;if(n<=3)return true;if(n%2==0||n%3==0)return false;for(int i=5;i*i<=n;i=i+6)if(n%i==0||n%(i+2)==0)return false;return true;}
long long fact(long long n){
    ll val=1;
    for(int i=1;i<=n;i++)val=(val*i)%mod;
    return val; }
#define pi 3.141592653589793238
#define N cout<<"NO"<<endl; 
#define Y cout<<"YES"<<endl; 
using namespace std;

int main(){
ll t;cin>>t;
while(t--){
    ll l,r;cin>>l>>r;
    ll cnt=0;
    while(r!=0){
        r/=2;
        cnt++;
    }
    cnt--;
    ll el=pow(2,cnt);
    cout<<el<<" "<<el-1<<" "<<el-2<<endl;
}
return 0;
}


Submission (verdict: Wrong answer on test 1):
#include<bits/stdc++.h>
#include<iostream>
#include<vector>
using ll=long long;
ll mod=1000000007;
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
ll gcd(ll a, ll b){if (b == 0)return a;return gcd(b, a % b);}
ll lcm(ll a, ll b){return ((a/gcd(a,b))*b);}
bool isPrime(int n){if(n<=1)return false;if(n<=3)return true;if(n%2==0||n%3==0)return false;for(int i=5;i*i<=n;i=i+6)if(n%i==0||n%(i+2)==0)return false;return true;}
long long fact(long long n){
    ll val=1;
    for(int i=1;i<=n;i++)val=(val*i)%mod;
    return val; }
#define pi 3.141592653589793238
#define N cout<<"NO"<<endl; 
#define Y cout<<"YES"<<endl; 
using namespace std;

int main(){
ll t;cin>>t;
while(t--){
    ll l,r;cin>>l>>r;
    ll cnt=0;
    while(r!=0){
        r/=2;
        cnt++;
    }
    cnt--;
    ll el=pow(2,cnt);
    if(el-2>=l)
    cout<<el<<" "<<el-1<<" "<<el-2<<endl;
    else if(el-1==l)
    cout<<el<<" "<<el-1<<" "<<el+1<<endl;
    else {
        cout<<el<<" "<<el+1<<" "<<el+2<<endl;
    }
}
return 0;
}
Problem: 2060D - Subtract Min Sort
Language: C++17 (GCC 7-32)

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

int main(){
    int test;
    cin >> test;
    for (int i=0; i<test;i++){
        int n;
        vector<int> arr;
        cin >> n;
        for (int j=0; j<n; j++){
            int x;
            cin >> x;
            arr.push_back(x);
        }
        vector<int> sarr = arr;
        sort(sarr.begin(), sarr.end());
        bool possible = true;
        if (arr == sarr){
            cout << "YES" << "\n";
        }
        else {
            if (arr[0] == sarr[n-1]) cout << "NO" << "\n";
            else {
                for(int j=0;j<n-2;j++){
                    if (arr[j+1]-arr[j] < arr[j+2]){
                        arr[j+1] -= arr[j];
                        arr[j] =0;
                    }
                    else {
                        cout << "NO" << "\n";
                        possible = false;
                        break;
                    }
                }
                if (possible = true) cout << "YES" << "\n";
            }
        }
    }
}

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

int main(){
    int test;
    cin >> test;
    for (int i=0; i<test;i++){
        int n;
        vector<int> arr;
        cin >> n;
        for (int j=0; j<n; j++){
            int x;
            cin >> x;
            arr.push_back(x);
        }
        vector<int> sarr = arr;
        sort(sarr.begin(), sarr.end());
        bool possible = true;
        if (arr == sarr){
            cout << "YES" << "\n";
        }
        else {
            if (arr[0] == sarr[n-1]) cout << "NO" << "\n";
            else {
                for(int j=0;j<n-2;j++){
                    if (arr[j+1]-arr[j] <= arr[j+2]){
                        arr[j+1] -= arr[j];
                        arr[j] =0;
                    }
                    else {
                        cout << "NO" << "\n";
                        possible = false;
                        break;
                    }
                }
                if (possible == true) cout << "YES" << "\n";
            }
        }
    }
}
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;

int main(){
    int test;
    cin >> test;
    for (int i=0; i<test;i++){
        int n;
        vector<int> arr;
        cin >> n;
        for (int j=0; j<n; j++){
            int x;
            cin >> x;
            arr.push_back(x);
        }
        vector<int> sarr = arr;
        sort(sarr.begin(), sarr.end());
        bool possible = true;
        if (arr == sarr){
            cout << "YES" << "\n";
        }
        else {
            if (arr[0] == sarr[n-1]) cout << "NO" << "\n";
            else {
                for(int j=0;j<n-2;j++){
                    if (arr[j+1]-arr[j] < arr[j+2]){
                        arr[j+1] -= arr[j];
                        arr[j] =0;
                    }
                    else {
                        cout << "NO" << "\n";
                        possible = false;
                        break;
                    }
                }
                if (possible = true) cout << "YES" << "\n";
            }
        }
    }
}