ShaysXIA/CodeInsightBench huggingface dataset:
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() {
	// your code goes here
int t;
cin>>t;
while(t--)
{
    int n;
    cin>>n;
    vector<int>v(n);
    for(int i=0;i<n;i++)
    {
        cin>>v[i];
    }
    int ctr=0; int ctr2=0;
    for(int i=0;i<n-1;i++)
    {
        int sub=min(v[i],v[i+1]);
        v[i]=v[i]-sub;
        v[i+1]=v[i+1]-sub;
        if(v[i]>=v[i+1])
        {
            cout<<"NO"<<endl;
            break;
        }
        else ctr++;
    }
    if(ctr==n-1)
    cout<<"YES"<<endl;
   
}
}


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

int main() {
	// your code goes here
int t;
cin>>t;
while(t--)
{
    int n;
    cin>>n;
    vector<int>v(n);
    for(int i=0;i<n;i++)
    {
        cin>>v[i];
    }
    int ctr=0; int ctr2=0;
    for(int i=0;i<n-1;i++)
    {
        int sub=min(v[i],v[i+1]);
        v[i]=v[i]-sub;
        v[i+1]=v[i+1]-sub;
        if(v[i]>v[i+1])
        {
            cout<<"NO"<<endl;
            break;
        }
        else ctr++;
    }
    if(ctr==n-1)
    cout<<"YES"<<endl;
   
}
}
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() {
	// your code goes here
int t;
cin>>t;
while(t--)
{
    int n;
    cin>>n;
    vector<int>v(n);
    for(int i=0;i<n;i++)
    {
        cin>>v[i];
    }
    int ctr=0; int ctr2=0;
    for(int i=0;i<n-1;i++)
    {
        int sub=min(v[i],v[i+1]);
        v[i]=v[i]-sub;
        v[i+1]=v[i+1]-sub;
        if(v[i]>=v[i+1])
        {
            cout<<"NO"<<endl;
            break;
        }
        else ctr++;
    }
    if(ctr>0)
    cout<<"YES"<<endl;
   
}
}
Problem: 2050B - Transfusion
Language: C++17 (GCC 7-32)

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



using namespace std;



void solve() {

  int n;

  cin >> n;

  vector<int> arr(n);



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



  long long odds = 0, evens = 0, total = 0;

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

    if (i % 2) {

      odds += arr[i];

    } else {

      evens += arr[i];

    }

    total += arr[i];

  }

  int len_odd = n / 2, len_even = n / 2;

  if (n % 2) {

    len_even++;

  }



  if (odds % len_odd != 0 || evens % len_even != 0 || total % n != 0) {

    cout << "NO" << endl;

  } else {

    cout << "YES" << endl;

  }

}



int main() {

  int t;

  cin >> t;

  while (t--) {

    solve();

  }

  return 0;

}



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



using namespace std;



void solve() {

  int n;

  cin >> n;

  vector<int> arr(n);



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

    cin >> arr[i];



  long long odds = 0, evens = 0, total = 0;

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

    if (i % 2) {

      odds += arr[i];

    } else {

      evens += arr[i];

    }

  }

  int len_odd = n / 2, len_even = n / 2;

  if (n % 2) {

    len_even++;

  }



  if (odds % len_odd != 0 || evens % len_even != 0 ||

      odds / len_odd != evens != len_even) {

    cout << "NO" << endl;

  } else {

    cout << "YES" << endl;

  }

}



int main() {

  int t;

  cin >> t;

  while (t--) {

    solve();

  }

  return 0;

}
Problem: 2050B - Transfusion
Language: C++17 (GCC 7-32)

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



using namespace std;



void solve() {

  int n;

  cin >> n;

  vector<int> arr(n);



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

    cin >> arr[i];



  long long odds = 0, evens = 0, total = 0;

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

    if (i % 2) {

      odds += arr[i];

    } else {

      evens += arr[i];

    }

  }

  int len_odd = n / 2, len_even = n / 2;

  if (n % 2) {

    len_even++;

  }



  if (odds % len_odd != 0 || evens % len_even != 0 ||

      odds / len_odd != evens != len_even) {

    cout << "NO" << endl;

  } else {

    cout << "YES" << endl;

  }

}



int main() {

  int t;

  cin >> t;

  while (t--) {

    solve();

  }

  return 0;

}



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



using namespace std;



void solve() {

  int n;

  cin >> n;

  vector<int> arr(n);



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

    cin >> arr[i];



  long long odds = 0, evens = 0, total = 0;

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

    if (i % 2) {

      odds += arr[i];

    } else {

      evens += arr[i];

    }

  }

  int len_odd = n / 2, len_even = n / 2;

  if (n % 2) {

    len_even++;

  }



  if (odds % len_odd != 0 || evens % len_even != 0 ||

      odds / len_odd != evens / len_even) {

    cout << "NO" << endl;

  } else {

    cout << "YES" << endl;

  }

}



int main() {

  int t;

  cin >> t;

  while (t--) {

    solve();

  }

  return 0;

}
Problem: 2050B - Transfusion
Language: C++17 (GCC 7-32)


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



using namespace std;



void solve() {

  int n;

  cin >> n;

  vector<int> arr(n);



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



  long long odds = 0, evens = 0, total = 0;

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

    if (i % 2) {

      odds += arr[i];

    } else {

      evens += arr[i];

    }

    total += arr[i];

  }

  int len_odd = n / 2, len_even = n / 2;

  if (n % 2) {

    len_even++;

  }



  if (odds % len_odd != 0 || evens % len_even != 0 || total % n != 0) {

    cout << "NO" << endl;

  } else {

    cout << "YES" << endl;

  }

}



int main() {

  int t;

  cin >> t;

  while (t--) {

    solve();

  }

  return 0;

}
Problem: 2057C - Trip to the Olympiad
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 1):
/*
[[ ⣇⣿⠘⣿⣿⣿⡿⡿⣟⣟⢟⢟⢝⠵⡝⣿⡿⢂⣼⣿⣷⣌⠩⡫⡻⣝⠹⢿⣿⣷ ]],
[[ ⡆⣿⣆⠱⣝⡵⣝⢅⠙⣿⢕⢕⢕⢕⢝⣥⢒⠅⣿⣿⣿⡿⣳⣌⠪⡪⣡⢑⢝⣇ ]],
[[ ⡆⣿⣿⣦⠹⣳⣳⣕⢅⠈⢗⢕⢕⢕⢕⢕⢈⢆⠟⠋⠉⠁⠉⠉⠁⠈⠼⢐⢕⢽ ]],
[[ ⡗⢰⣶⣶⣦⣝⢝⢕⢕⠅⡆⢕⢕⢕⢕⢕⣴⠏⣠⡶⠛⡉⡉⡛⢶⣦⡀⠐⣕⢕ ]],
[[ ⡝⡄⢻⢟⣿⣿⣷⣕⣕⣅⣿⣔⣕⣵⣵⣿⣿⢠⣿⢠⣮⡈⣌⠨⠅⠹⣷⡀⢱⢕ ]],
[[ ⡝⡵⠟⠈⢀⣀⣀⡀⠉⢿⣿⣿⣿⣿⣿⣿⣿⣼⣿⢈⡋⠴⢿⡟⣡⡇⣿⡇⡀⢕ ]],
[[ ⡝⠁⣠⣾⠟⡉⡉⡉⠻⣦⣻⣿⣿⣿⣿⣿⣿⣿⣿⣧⠸⣿⣦⣥⣿⡇⡿⣰⢗⢄ ]],
[[ ⠁⢰⣿⡏⣴⣌⠈⣌⠡⠈⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣬⣉⣉⣁⣄⢖⢕⢕⢕ ]],
[[ ⡀⢻⣿⡇⢙⠁⠴⢿⡟⣡⡆⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣵⣵⣿ ]],
[[ ⡻⣄⣻⣿⣌⠘⢿⣷⣥⣿⠇⣿⣿⣿⣿⣿⣿⠛⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ]],
[[ ⣷⢄⠻⣿⣟⠿⠦⠍⠉⣡⣾⣿⣿⣿⣿⣿⣿⢸⣿⣦⠙⣿⣿⣿⣿⣿⣿⣿⣿⠟ ]],
[[ ⡕⡑⣑⣈⣻⢗⢟⢞⢝⣻⣿⣿⣿⣿⣿⣿⣿⠸⣿⠿⠃⣿⣿⣿⣿⣿⣿⡿⠁⣠ ]],
[[ ⡝⡵⡈⢟⢕⢕⢕⢕⣵⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣶⣿⣿⣿⣿⣿⠿⠋⣀⣈⠙ ]],
[[ ⡝⡵⡕⡀⠑⠳⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⢉⡠⡲⡫⡪⡪⡣ ]],
*/
/* #pragma GCC optimize(2) */
#include <iostream>
using namespace std;
#define endl '\n'
#define ll long long
#define Debug(x) cout << #x << ':' << x << endl
#define all(x) (x).begin(), (x).end()

void solve() {
        int l, r;
        cin >> l >> r;
        int k = 31 - __builtin_clz(l ^ r);
        int a = 1 | (1 << k) | 1, b = a + 1, c = a == l ? r : l;
        cout << a << ' ' << b << ' ' << c << endl;
}

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

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

        return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 1):
/*
[[ ⣇⣿⠘⣿⣿⣿⡿⡿⣟⣟⢟⢟⢝⠵⡝⣿⡿⢂⣼⣿⣷⣌⠩⡫⡻⣝⠹⢿⣿⣷ ]],
[[ ⡆⣿⣆⠱⣝⡵⣝⢅⠙⣿⢕⢕⢕⢕⢝⣥⢒⠅⣿⣿⣿⡿⣳⣌⠪⡪⣡⢑⢝⣇ ]],
[[ ⡆⣿⣿⣦⠹⣳⣳⣕⢅⠈⢗⢕⢕⢕⢕⢕⢈⢆⠟⠋⠉⠁⠉⠉⠁⠈⠼⢐⢕⢽ ]],
[[ ⡗⢰⣶⣶⣦⣝⢝⢕⢕⠅⡆⢕⢕⢕⢕⢕⣴⠏⣠⡶⠛⡉⡉⡛⢶⣦⡀⠐⣕⢕ ]],
[[ ⡝⡄⢻⢟⣿⣿⣷⣕⣕⣅⣿⣔⣕⣵⣵⣿⣿⢠⣿⢠⣮⡈⣌⠨⠅⠹⣷⡀⢱⢕ ]],
[[ ⡝⡵⠟⠈⢀⣀⣀⡀⠉⢿⣿⣿⣿⣿⣿⣿⣿⣼⣿⢈⡋⠴⢿⡟⣡⡇⣿⡇⡀⢕ ]],
[[ ⡝⠁⣠⣾⠟⡉⡉⡉⠻⣦⣻⣿⣿⣿⣿⣿⣿⣿⣿⣧⠸⣿⣦⣥⣿⡇⡿⣰⢗⢄ ]],
[[ ⠁⢰⣿⡏⣴⣌⠈⣌⠡⠈⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣬⣉⣉⣁⣄⢖⢕⢕⢕ ]],
[[ ⡀⢻⣿⡇⢙⠁⠴⢿⡟⣡⡆⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣵⣵⣿ ]],
[[ ⡻⣄⣻⣿⣌⠘⢿⣷⣥⣿⠇⣿⣿⣿⣿⣿⣿⠛⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ]],
[[ ⣷⢄⠻⣿⣟⠿⠦⠍⠉⣡⣾⣿⣿⣿⣿⣿⣿⢸⣿⣦⠙⣿⣿⣿⣿⣿⣿⣿⣿⠟ ]],
[[ ⡕⡑⣑⣈⣻⢗⢟⢞⢝⣻⣿⣿⣿⣿⣿⣿⣿⠸⣿⠿⠃⣿⣿⣿⣿⣿⣿⡿⠁⣠ ]],
[[ ⡝⡵⡈⢟⢕⢕⢕⢕⣵⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣶⣿⣿⣿⣿⣿⠿⠋⣀⣈⠙ ]],
[[ ⡝⡵⡕⡀⠑⠳⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⢉⡠⡲⡫⡪⡪⡣ ]],
*/
/* #pragma GCC optimize(2) */
#include <iostream>
using namespace std;
#define endl '\n'
#define ll long long
#define Debug(x) cout << #x << ':' << x << endl
#define all(x) (x).begin(), (x).end()

void solve() {
        int l, r;
        cin >> l >> r;
        int k = 31 - __builtin_clz(l ^ r);
        int a = 1 | (1 << k) - 1, b = a + 1, c = a == l ? r : l;
        cout << a << ' ' << b << ' ' << c << endl;
}

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

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

        return 0;
}


Submission (verdict: Wrong answer on test 1):
/*
[[ ⣇⣿⠘⣿⣿⣿⡿⡿⣟⣟⢟⢟⢝⠵⡝⣿⡿⢂⣼⣿⣷⣌⠩⡫⡻⣝⠹⢿⣿⣷ ]],
[[ ⡆⣿⣆⠱⣝⡵⣝⢅⠙⣿⢕⢕⢕⢕⢝⣥⢒⠅⣿⣿⣿⡿⣳⣌⠪⡪⣡⢑⢝⣇ ]],
[[ ⡆⣿⣿⣦⠹⣳⣳⣕⢅⠈⢗⢕⢕⢕⢕⢕⢈⢆⠟⠋⠉⠁⠉⠉⠁⠈⠼⢐⢕⢽ ]],
[[ ⡗⢰⣶⣶⣦⣝⢝⢕⢕⠅⡆⢕⢕⢕⢕⢕⣴⠏⣠⡶⠛⡉⡉⡛⢶⣦⡀⠐⣕⢕ ]],
[[ ⡝⡄⢻⢟⣿⣿⣷⣕⣕⣅⣿⣔⣕⣵⣵⣿⣿⢠⣿⢠⣮⡈⣌⠨⠅⠹⣷⡀⢱⢕ ]],
[[ ⡝⡵⠟⠈⢀⣀⣀⡀⠉⢿⣿⣿⣿⣿⣿⣿⣿⣼⣿⢈⡋⠴⢿⡟⣡⡇⣿⡇⡀⢕ ]],
[[ ⡝⠁⣠⣾⠟⡉⡉⡉⠻⣦⣻⣿⣿⣿⣿⣿⣿⣿⣿⣧⠸⣿⣦⣥⣿⡇⡿⣰⢗⢄ ]],
[[ ⠁⢰⣿⡏⣴⣌⠈⣌⠡⠈⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣬⣉⣉⣁⣄⢖⢕⢕⢕ ]],
[[ ⡀⢻⣿⡇⢙⠁⠴⢿⡟⣡⡆⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣵⣵⣿ ]],
[[ ⡻⣄⣻⣿⣌⠘⢿⣷⣥⣿⠇⣿⣿⣿⣿⣿⣿⠛⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ]],
[[ ⣷⢄⠻⣿⣟⠿⠦⠍⠉⣡⣾⣿⣿⣿⣿⣿⣿⢸⣿⣦⠙⣿⣿⣿⣿⣿⣿⣿⣿⠟ ]],
[[ ⡕⡑⣑⣈⣻⢗⢟⢞⢝⣻⣿⣿⣿⣿⣿⣿⣿⠸⣿⠿⠃⣿⣿⣿⣿⣿⣿⡿⠁⣠ ]],
[[ ⡝⡵⡈⢟⢕⢕⢕⢕⣵⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣶⣿⣿⣿⣿⣿⠿⠋⣀⣈⠙ ]],
[[ ⡝⡵⡕⡀⠑⠳⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⢉⡠⡲⡫⡪⡪⡣ ]],
*/
/* #pragma GCC optimize(2) */
#include <iostream>
using namespace std;
#define endl '\n'
#define ll long long
#define Debug(x) cout << #x << ':' << x << endl
#define all(x) (x).begin(), (x).end()

void solve() {
        int l, r;
        cin >> l >> r;
        int k = 31 - __builtin_clz(l ^ r);
        int a = 1 | ((1 << k) - 1), b = a + 1, c = a == l ? r : l;
        cout << a << ' ' << b << ' ' << c << endl;
}

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

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

        return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 1):
/*
[[ ⣇⣿⠘⣿⣿⣿⡿⡿⣟⣟⢟⢟⢝⠵⡝⣿⡿⢂⣼⣿⣷⣌⠩⡫⡻⣝⠹⢿⣿⣷ ]],
[[ ⡆⣿⣆⠱⣝⡵⣝⢅⠙⣿⢕⢕⢕⢕⢝⣥⢒⠅⣿⣿⣿⡿⣳⣌⠪⡪⣡⢑⢝⣇ ]],
[[ ⡆⣿⣿⣦⠹⣳⣳⣕⢅⠈⢗⢕⢕⢕⢕⢕⢈⢆⠟⠋⠉⠁⠉⠉⠁⠈⠼⢐⢕⢽ ]],
[[ ⡗⢰⣶⣶⣦⣝⢝⢕⢕⠅⡆⢕⢕⢕⢕⢕⣴⠏⣠⡶⠛⡉⡉⡛⢶⣦⡀⠐⣕⢕ ]],
[[ ⡝⡄⢻⢟⣿⣿⣷⣕⣕⣅⣿⣔⣕⣵⣵⣿⣿⢠⣿⢠⣮⡈⣌⠨⠅⠹⣷⡀⢱⢕ ]],
[[ ⡝⡵⠟⠈⢀⣀⣀⡀⠉⢿⣿⣿⣿⣿⣿⣿⣿⣼⣿⢈⡋⠴⢿⡟⣡⡇⣿⡇⡀⢕ ]],
[[ ⡝⠁⣠⣾⠟⡉⡉⡉⠻⣦⣻⣿⣿⣿⣿⣿⣿⣿⣿⣧⠸⣿⣦⣥⣿⡇⡿⣰⢗⢄ ]],
[[ ⠁⢰⣿⡏⣴⣌⠈⣌⠡⠈⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣬⣉⣉⣁⣄⢖⢕⢕⢕ ]],
[[ ⡀⢻⣿⡇⢙⠁⠴⢿⡟⣡⡆⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣵⣵⣿ ]],
[[ ⡻⣄⣻⣿⣌⠘⢿⣷⣥⣿⠇⣿⣿⣿⣿⣿⣿⠛⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ]],
[[ ⣷⢄⠻⣿⣟⠿⠦⠍⠉⣡⣾⣿⣿⣿⣿⣿⣿⢸⣿⣦⠙⣿⣿⣿⣿⣿⣿⣿⣿⠟ ]],
[[ ⡕⡑⣑⣈⣻⢗⢟⢞⢝⣻⣿⣿⣿⣿⣿⣿⣿⠸⣿⠿⠃⣿⣿⣿⣿⣿⣿⡿⠁⣠ ]],
[[ ⡝⡵⡈⢟⢕⢕⢕⢕⣵⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣶⣿⣿⣿⣿⣿⠿⠋⣀⣈⠙ ]],
[[ ⡝⡵⡕⡀⠑⠳⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⢉⡠⡲⡫⡪⡪⡣ ]],
*/
/* #pragma GCC optimize(2) */
#include <iostream>
using namespace std;
#define endl '\n'
#define ll long long
#define Debug(x) cout << #x << ':' << x << endl
#define all(x) (x).begin(), (x).end()

void solve() {
        int l, r;
        cin >> l >> r;
        int k = 31 - __builtin_clz(l ^ r);
        int a = 1 | ((1 << k) - 1), b = a + 1, c = a == l ? r : l;
        cout << a << ' ' << b << ' ' << c << endl;
}

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

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

        return 0;
}


Submission (verdict: Accepted):
/*
[[ ⣇⣿⠘⣿⣿⣿⡿⡿⣟⣟⢟⢟⢝⠵⡝⣿⡿⢂⣼⣿⣷⣌⠩⡫⡻⣝⠹⢿⣿⣷ ]],
[[ ⡆⣿⣆⠱⣝⡵⣝⢅⠙⣿⢕⢕⢕⢕⢝⣥⢒⠅⣿⣿⣿⡿⣳⣌⠪⡪⣡⢑⢝⣇ ]],
[[ ⡆⣿⣿⣦⠹⣳⣳⣕⢅⠈⢗⢕⢕⢕⢕⢕⢈⢆⠟⠋⠉⠁⠉⠉⠁⠈⠼⢐⢕⢽ ]],
[[ ⡗⢰⣶⣶⣦⣝⢝⢕⢕⠅⡆⢕⢕⢕⢕⢕⣴⠏⣠⡶⠛⡉⡉⡛⢶⣦⡀⠐⣕⢕ ]],
[[ ⡝⡄⢻⢟⣿⣿⣷⣕⣕⣅⣿⣔⣕⣵⣵⣿⣿⢠⣿⢠⣮⡈⣌⠨⠅⠹⣷⡀⢱⢕ ]],
[[ ⡝⡵⠟⠈⢀⣀⣀⡀⠉⢿⣿⣿⣿⣿⣿⣿⣿⣼⣿⢈⡋⠴⢿⡟⣡⡇⣿⡇⡀⢕ ]],
[[ ⡝⠁⣠⣾⠟⡉⡉⡉⠻⣦⣻⣿⣿⣿⣿⣿⣿⣿⣿⣧⠸⣿⣦⣥⣿⡇⡿⣰⢗⢄ ]],
[[ ⠁⢰⣿⡏⣴⣌⠈⣌⠡⠈⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣬⣉⣉⣁⣄⢖⢕⢕⢕ ]],
[[ ⡀⢻⣿⡇⢙⠁⠴⢿⡟⣡⡆⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣵⣵⣿ ]],
[[ ⡻⣄⣻⣿⣌⠘⢿⣷⣥⣿⠇⣿⣿⣿⣿⣿⣿⠛⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ]],
[[ ⣷⢄⠻⣿⣟⠿⠦⠍⠉⣡⣾⣿⣿⣿⣿⣿⣿⢸⣿⣦⠙⣿⣿⣿⣿⣿⣿⣿⣿⠟ ]],
[[ ⡕⡑⣑⣈⣻⢗⢟⢞⢝⣻⣿⣿⣿⣿⣿⣿⣿⠸⣿⠿⠃⣿⣿⣿⣿⣿⣿⡿⠁⣠ ]],
[[ ⡝⡵⡈⢟⢕⢕⢕⢕⣵⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣶⣿⣿⣿⣿⣿⠿⠋⣀⣈⠙ ]],
[[ ⡝⡵⡕⡀⠑⠳⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⢉⡠⡲⡫⡪⡪⡣ ]],
*/
/* #pragma GCC optimize(2) */
#include <iostream>
using namespace std;
#define endl '\n'
#define ll long long
#define Debug(x) cout << #x << ':' << x << endl
#define all(x) (x).begin(), (x).end()

void solve() {
        int l, r;
        cin >> l >> r;
        int k = 31 - __builtin_clz(l ^ r);
        int a = l | ((1 << k) - 1), b = a + 1, c = (a == l ? r : l);
        cout << a << ' ' << b << ' ' << c << endl;
}

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

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

        return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 1):
/*
[[ ⣇⣿⠘⣿⣿⣿⡿⡿⣟⣟⢟⢟⢝⠵⡝⣿⡿⢂⣼⣿⣷⣌⠩⡫⡻⣝⠹⢿⣿⣷ ]],
[[ ⡆⣿⣆⠱⣝⡵⣝⢅⠙⣿⢕⢕⢕⢕⢝⣥⢒⠅⣿⣿⣿⡿⣳⣌⠪⡪⣡⢑⢝⣇ ]],
[[ ⡆⣿⣿⣦⠹⣳⣳⣕⢅⠈⢗⢕⢕⢕⢕⢕⢈⢆⠟⠋⠉⠁⠉⠉⠁⠈⠼⢐⢕⢽ ]],
[[ ⡗⢰⣶⣶⣦⣝⢝⢕⢕⠅⡆⢕⢕⢕⢕⢕⣴⠏⣠⡶⠛⡉⡉⡛⢶⣦⡀⠐⣕⢕ ]],
[[ ⡝⡄⢻⢟⣿⣿⣷⣕⣕⣅⣿⣔⣕⣵⣵⣿⣿⢠⣿⢠⣮⡈⣌⠨⠅⠹⣷⡀⢱⢕ ]],
[[ ⡝⡵⠟⠈⢀⣀⣀⡀⠉⢿⣿⣿⣿⣿⣿⣿⣿⣼⣿⢈⡋⠴⢿⡟⣡⡇⣿⡇⡀⢕ ]],
[[ ⡝⠁⣠⣾⠟⡉⡉⡉⠻⣦⣻⣿⣿⣿⣿⣿⣿⣿⣿⣧⠸⣿⣦⣥⣿⡇⡿⣰⢗⢄ ]],
[[ ⠁⢰⣿⡏⣴⣌⠈⣌⠡⠈⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣬⣉⣉⣁⣄⢖⢕⢕⢕ ]],
[[ ⡀⢻⣿⡇⢙⠁⠴⢿⡟⣡⡆⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣵⣵⣿ ]],
[[ ⡻⣄⣻⣿⣌⠘⢿⣷⣥⣿⠇⣿⣿⣿⣿⣿⣿⠛⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ]],
[[ ⣷⢄⠻⣿⣟⠿⠦⠍⠉⣡⣾⣿⣿⣿⣿⣿⣿⢸⣿⣦⠙⣿⣿⣿⣿⣿⣿⣿⣿⠟ ]],
[[ ⡕⡑⣑⣈⣻⢗⢟⢞⢝⣻⣿⣿⣿⣿⣿⣿⣿⠸⣿⠿⠃⣿⣿⣿⣿⣿⣿⡿⠁⣠ ]],
[[ ⡝⡵⡈⢟⢕⢕⢕⢕⣵⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣶⣿⣿⣿⣿⣿⠿⠋⣀⣈⠙ ]],
[[ ⡝⡵⡕⡀⠑⠳⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⢉⡠⡲⡫⡪⡪⡣ ]],
*/
/* #pragma GCC optimize(2) */
#include <iostream>
using namespace std;
#define endl '\n'
#define ll long long
#define Debug(x) cout << #x << ':' << x << endl
#define all(x) (x).begin(), (x).end()

void solve() {
        int l, r;
        cin >> l >> r;
        int k = 31 - __builtin_clz(l ^ r);
        int a = 1 | (1 << k) | 1, b = a + 1, c = a == l ? r : l;
        cout << a << ' ' << b << ' ' << c << endl;
}

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

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

        return 0;
}


Submission (verdict: Wrong answer on test 1):
/*
[[ ⣇⣿⠘⣿⣿⣿⡿⡿⣟⣟⢟⢟⢝⠵⡝⣿⡿⢂⣼⣿⣷⣌⠩⡫⡻⣝⠹⢿⣿⣷ ]],
[[ ⡆⣿⣆⠱⣝⡵⣝⢅⠙⣿⢕⢕⢕⢕⢝⣥⢒⠅⣿⣿⣿⡿⣳⣌⠪⡪⣡⢑⢝⣇ ]],
[[ ⡆⣿⣿⣦⠹⣳⣳⣕⢅⠈⢗⢕⢕⢕⢕⢕⢈⢆⠟⠋⠉⠁⠉⠉⠁⠈⠼⢐⢕⢽ ]],
[[ ⡗⢰⣶⣶⣦⣝⢝⢕⢕⠅⡆⢕⢕⢕⢕⢕⣴⠏⣠⡶⠛⡉⡉⡛⢶⣦⡀⠐⣕⢕ ]],
[[ ⡝⡄⢻⢟⣿⣿⣷⣕⣕⣅⣿⣔⣕⣵⣵⣿⣿⢠⣿⢠⣮⡈⣌⠨⠅⠹⣷⡀⢱⢕ ]],
[[ ⡝⡵⠟⠈⢀⣀⣀⡀⠉⢿⣿⣿⣿⣿⣿⣿⣿⣼⣿⢈⡋⠴⢿⡟⣡⡇⣿⡇⡀⢕ ]],
[[ ⡝⠁⣠⣾⠟⡉⡉⡉⠻⣦⣻⣿⣿⣿⣿⣿⣿⣿⣿⣧⠸⣿⣦⣥⣿⡇⡿⣰⢗⢄ ]],
[[ ⠁⢰⣿⡏⣴⣌⠈⣌⠡⠈⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣬⣉⣉⣁⣄⢖⢕⢕⢕ ]],
[[ ⡀⢻⣿⡇⢙⠁⠴⢿⡟⣡⡆⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣵⣵⣿ ]],
[[ ⡻⣄⣻⣿⣌⠘⢿⣷⣥⣿⠇⣿⣿⣿⣿⣿⣿⠛⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ]],
[[ ⣷⢄⠻⣿⣟⠿⠦⠍⠉⣡⣾⣿⣿⣿⣿⣿⣿⢸⣿⣦⠙⣿⣿⣿⣿⣿⣿⣿⣿⠟ ]],
[[ ⡕⡑⣑⣈⣻⢗⢟⢞⢝⣻⣿⣿⣿⣿⣿⣿⣿⠸⣿⠿⠃⣿⣿⣿⣿⣿⣿⡿⠁⣠ ]],
[[ ⡝⡵⡈⢟⢕⢕⢕⢕⣵⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣶⣿⣿⣿⣿⣿⠿⠋⣀⣈⠙ ]],
[[ ⡝⡵⡕⡀⠑⠳⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⢉⡠⡲⡫⡪⡪⡣ ]],
*/
/* #pragma GCC optimize(2) */
#include <iostream>
using namespace std;
#define endl '\n'
#define ll long long
#define Debug(x) cout << #x << ':' << x << endl
#define all(x) (x).begin(), (x).end()

void solve() {
        int l, r;
        cin >> l >> r;
        int k = 31 - __builtin_clz(l ^ r);
        int a = 1 | (1 << k) - 1, b = a + 1, c = a == l ? r : l;
        cout << a << ' ' << b << ' ' << c << endl;
}

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

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

        return 0;
}
Problem: 2062C - Cirno and Operations
Language: C++23 (GCC 14-64, msys2)


Submission (verdict: Wrong answer on test 2):
/*
    Coded By : Tanishq Shah
    Created : 05.02.2025  16:23:43
    Problem : 2062C
*/

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

#define King ios_base::sync_with_stdio(0);
#define T cin.tie(0); cout.tie(0);
#define endl '\n'
#define ll long long
#define stc static_cast
#define V vector
#define vll vector<ll>
#define pll pair<long long, long long>
#define mll map<long long, long long>
#define umll unordered_map<long long, long long>
#define vvl vector<vector<long long>>
#define srt(v) sort(v.begin(), v.end())
#define rev(x) reverse(x.begin(),x.end())
#define maxEle(v) *max_element(v.begin(), v.end())
#define minEle(v) *min_element(v.begin(), v.end())
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define bitcount __builtin_popcountll
#define ff first
#define ss second
#define yes cout << "YES\n"
#define no cout << "NO\n"
#define one cout << "-1\n"
#define entr cout << '\n'
#define done return
#define fr(i, l, r) for(ll i=(l); i<(r); i++)
#define frr(i, r, l) for(ll i=(r-1); i>=l; i--)
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const long long INF = 1e18 + 9;
const int MOD = 1e9 + 7;
const long long MOD1 = 998244353;

ll gcd(ll a, ll b) { return (b == 0) ? a : gcd(b, a % b); }
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }
bool isPrime(ll n) {
    if(n <= 1) return false; if(n <= 3) return true; if(n % 2 == 0 || n % 3 == 0) return false;
    for(ll i=5; i*i<=n; i+=6) { if(n % i == 0 || n % (i+2) == 0) return false;}
    return true;
}
ll power(ll a, ll b) {
    ll ans = 1; a %= MOD;
    while(b > 0) { if(b & 1) { ans = (ans * a) % MOD; } a = (a * a) % MOD; b >>= 1; }
    return ans;
}
bool compbyss(const pair<int, int>& a, const pair<int, int>& b) { if(a.second == b.second) { return a.first < b.first; } return a.second < b.second; }


// =-=-=-=-=-=-=-=-=-=-=-=-=-code starts here -=-=-=-=-=-=-=-=-=-=-=-=-= //

void idharDekh()
{
    ll n;
    cin >> n;
    vll a(n);
    ll z=n;
    fr(i, 0, n) cin >> a[i];
    ll ans=INT_MIN;
    fr(i,0,n){
        ll sum=0;
        fr(j,0,z){
            sum+=a[j];
            ans=max(ans,sum);
        }
        reverse(a.begin(),a.end());
        fr(i,0,z-1){
            a[i]=a[i+1]-a[i];
        }
        a.ppb();
        z--;
    }
    cout<<ans<<endl;
}

signed main()
{
    auto begin = std::chrono::high_resolution_clock::now();
    King T
    ll t = 1;
    cin >> t;
    while (t--)
    {
        idharDekh();
    }
    auto end = std::chrono::high_resolution_clock::now();
    auto elapsed = std::chrono::duration_cast<std::chrono::nanoseconds>(end - begin);
    cerr << "Time measured: " << elapsed.count() * 1e-9 << " seconds.\n";
    return 0;
}
Problem: 2063B - Subsequence Update
Language: C++17 (GCC 7-32)


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

using namespace std;



#define int 			long long int

#define double			long double

#define F			first

#define S 			second

#define pb 			push_back

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

#define vi 			vector<int>

#define pii			pair<int, int>

#define rep(i, a, b) 		for(int i = a; i < b; i++)

#define CODE_START 		ios_base::sync_with_stdio();cin.tie(0);cout.tie(0);



void solve() {

	int n, l, r;

	cin >> n >> l >> r;

	vi a(n);

	rep(i, 0, n) cin >> a[i];



	int curr_sum = 0, sum = 0, len = 0, d = r-l+1;

	rep(i, l-1, r) curr_sum += a[i];

	int mn = curr_sum;



	vi prefix(d+1);

	rep(i, 1, d+1) prefix[i] = prefix[i-1] + a[l+i-2];



	rep(i, 0, n) {

		if(sum + a[i] <= curr_sum) {

			sum += a[i];

			len++;

		}

		else {

			sum = a[i];

			len = 1;

		}

		mn = min(mn, curr_sum - prefix[len] + sum);

		if(len == d) {

			sum -= a[i-r+l];

			len--;

		}

	}



	

	vi suffix(d+1);

	for(int i = d-1; i >= 0; i--) suffix[i] = suffix[i+1] + a[r-d+i];

	

	sum = 0;

	len = 0;



	for(int i = n-1; i >= l; i--) {

		if(sum + a[i] <= curr_sum) {

			sum += a[i];

			len++;

		}

		else {

			sum = a[i];

			len = 1;

		}

		mn = min(mn, curr_sum - suffix[d-len] + sum);

		if(len == d) {

			sum -= a[i+r-l];

			len--;

		}

	}

	

	cout << mn << "\n";

}



int32_t main() {

	#ifdef CODE_START

		CODE_START;

	#endif



	int t;	

	cin >> t;

	while(t--) {

		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;



#define int 			long long int

#define double			long double

#define F			first

#define S 			second

#define pb 			push_back

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

#define vi 			vector<int>

#define pii			pair<int, int>

#define rep(i, a, b) 		for(int i = a; i < b; i++)

#define CODE_START 		ios_base::sync_with_stdio();cin.tie(0);cout.tie(0);



void solve() {

	int n, l, r;

	cin >> n >> l >> r;

	vi a(n);

	rep(i, 0, n) cin >> a[i];



	int curr_sum = 0, sum = 0, len = 0, d = r-l+1;

	rep(i, l-1, r) curr_sum += a[i];

	int mn = curr_sum;



	vi prefix(d+1);

	rep(i, 1, d+1) prefix[i] = prefix[i-1] + a[l+i-2];



	rep(i, 0, n) {

		if(sum + a[i] <= curr_sum) {

			sum += a[i];

			len++;

		}

		else {

			sum = a[i];

			len = 1;

		}

		mn = min(mn, curr_sum - prefix[len] + sum);

		if(len == d) {

			sum -= a[i-r+l];

			len--;

		}

	}



	

	vi suffix(d+1);

	for(int i = d-1; i >= 0; i--) suffix[i] = suffix[i+1] + a[r-d+i];

	

	sum = 0;

	len = 0;



	for(int i = n-1; i >= l; i--) {

		if(sum + a[i] <= curr_sum) {

			sum += a[i];

			len++;

		}

		else {

			sum = a[i];

			len = 1;

		}

		mn = min(mn, curr_sum - suffix[d-len] + sum);

		if(len == d) {

			sum -= a[i+r-l];

			len--;

		}

	}

	

	cout << mn << "\n";

}



int32_t main() {

	#ifdef CODE_START

		CODE_START;

	#endif



	int t;	

	cin >> t;

	while(t--) {

		solve();

	}

	return 0;

}



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

using namespace std;



#define int 			long long int

#define double			long double

#define F			first

#define S 			second

#define pb 			push_back

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

#define vi 			vector<int>

#define pii			pair<int, int>

#define rep(i, a, b) 		for(int i = a; i < b; i++)

#define CODE_START 		ios_base::sync_with_stdio();cin.tie(0);cout.tie(0);



void solve() {

	int n, l, r;

	cin >> n >> l >> r;

	vi a(n);

	rep(i, 0, n) cin >> a[i];



	int curr_sum = 0, sum = 0, len = 0, d = r-l+1;

	rep(i, l-1, r) curr_sum += a[i];

	int mn = curr_sum;



	vi prefix(d+1);

	rep(i, 1, d+1) prefix[i] = prefix[i-1] + a[l+i-2];



	rep(i, 0, r-1) {

		if(sum + a[i] < curr_sum) {

			sum += a[i];

			len++;

		}

		else {

			sum = a[i];

			len = 1;

		}

		mn = min(mn, curr_sum - prefix[len] + sum);

		if(len == d) {

			sum -= a[i-r+l];

			len--;

		}

	}

	

	vi suffix(d+1);

	for(int i = d-1; i >= 0; i--) suffix[i] = suffix[i+1] + a[r-d+i];

	

	sum = 0;

	len = 0;



	for(int i = n-1; i >= l; i--) {

		if(sum + a[i] < curr_sum) {

			sum += a[i];

			len++;

		}

		else {

			sum = a[i];

			len = 1;

		}

		mn = min(mn, curr_sum - suffix[d-len] + sum);

		if(len == d) {

			sum -= a[i+r-l];

			len--;

		}

	}

	

	cout << mn << "\n";

}



int32_t main() {

	#ifdef CODE_START

		CODE_START;

	#endif



	int t;	

	cin >> t;

	while(t--) {

		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;

#define int 			long long int
#define double			long double
#define F			first
#define S 			second
#define pb 			push_back
#define all(x) 			x.begin(), x.end()
#define vi 			vector<int>
#define pii			pair<int, int>
#define rep(i, a, b) 		for(int i = a; i < b; i++)
#define CODE_START 		ios_base::sync_with_stdio();cin.tie(0);cout.tie(0);

void solve() {
	int n, l, r;
	cin >> n >> l >> r;
	vi a(n);
	rep(i, 0, n) cin >> a[i];
	vi b;
	rep(i, l-1, r) b.pb(a[i]);
	sort(b.rbegin(), b.rend());
	int d = r-l+1;
	vi prefix(d+1);
	rep(i, 0, d) prefix[i+1] = prefix[i] + b[i];
	
	vi c;
	rep(i, 0, l-1) c.pb(a[i]);
	sort(all(c));

	int sum = 0, mn = prefix[d];
	rep(i, 0, (int)min(d, l-1)) {
		if(sum + c[i] < prefix[i+1]) {
			sum += c[i];
			mn = min(mn, prefix[d] - prefix[i+1] + sum);
		}
	}

	vi e;
	for(int i = n-1; i >= r; i--) e.pb(a[i]);
	sort(all(e));

	sum = 0;
	rep(i, 0, (int)min(d, n-r)) {
		if(sum + e[i] < prefix[i+1]) {
			sum += e[i];
			mn = min(mn, prefix[d] - prefix[i+1] + sum);
		}
	}

	cout << mn << "\n";
}

int32_t main() {
	#ifdef CODE_START
		CODE_START;
	#endif

	int t;	
	cin >> t;
	while(t--) {
		solve();
	}
	return 0;
}


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

#define int 			long long int
#define double			long double
#define F			first
#define S 			second
#define pb 			push_back
#define all(x) 			x.begin(), x.end()
#define vi 			vector<int>
#define pii			pair<int, int>
#define rep(i, a, b) 		for(int i = a; i < b; i++)
#define CODE_START 		ios_base::sync_with_stdio();cin.tie(0);cout.tie(0);

void solve() {
	int n, l, r;
	cin >> n >> l >> r;
	vi a(n);
	rep(i, 0, n) cin >> a[i];
	vi b;
	rep(i, l-1, r) b.pb(a[i]);
	sort(b.rbegin(), b.rend());
	int d = r-l+1;
	vi prefix(d+1);
	rep(i, 0, d) prefix[i+1] = prefix[i] + b[i];
	
	vi c;
	rep(i, 0, l-1) c.pb(a[i]);
	sort(all(c));

	int sum = 0, mn = prefix[d], len = 0;
	rep(i, 0, (int)c.size()) {
		if(sum + c[i] < prefix[i+1]) {
			sum += c[i];
			mn = min(mn, prefix[d] - prefix[i+1] + sum);
		}
		else break;
		len++;
		if(len == d) break;
	}

	vi e;
	for(int i = n-1; i >= r; i--) e.pb(a[i]);
	sort(all(e));

	sum = 0;
	len = 0;
	rep(i, 0, (int)e.size()) {
		if(sum + e[i] < prefix[i+1]) {
			sum += e[i];
			mn = min(mn, prefix[d] - prefix[i+1] + sum);
		}
		else break;
		len++;
		if(len == d) break;
	}

	cout << mn << "\n";
}

int32_t main() {
	#ifdef CODE_START
		CODE_START;
	#endif

	int t;	
	cin >> t;
	while(t--) {
		solve();
	}
	return 0;
}