ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2060D - Subtract Min Sort
Language: C++20 (GCC 13-64)

Previous submission (verdict: Time limit exceeded on test 8):
#include <bits/stdc++.h>
using namespace std;
int main() {
	int t,n;
	cin>>t;
	while(t--){
	    cin>>n;
	    vector<int> nums(n);
	    for(int i=0; i<n; i++){
	        cin>>nums[i];
	    }
	    for(int i=0; i<n-1; i++){
	        int sub = min(nums[i], nums[i+1]);
	        nums[i] = nums[i]-sub;
	         nums[i+1] = nums[i+1]-sub;
	         if(is_sorted(nums.begin(), nums.end())){
	             cout<<"YES"<<endl;
	             break;
	         }
	         else if(i==n-2){
	             cout<<"NO"<<endl;
	         }
	    }
	    
	    
	    
	    
	}
	return 0;
    
}
	    

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

int main() {
    int t, n;
    cin >> t;
    while (t--) {
        cin >> n;
        vector<int> nums(n);
        for (int i = 0; i < n; i++) {
            cin >> nums[i];
        }

        for (int i = 0; i < n - 1; i++) {
            int sub = min(nums[i], nums[i + 1]);
            nums[i] -= sub;
            nums[i + 1] -= sub;
        }

        // Check if the array is sorted
        if (is_sorted(nums.begin(), nums.end())) {
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }
    return 0;
}
Problem: 2060D - Subtract Min Sort
Language: C++20 (GCC 13-64)

Previous submission (verdict: Time limit exceeded on test 7):
#include <bits/stdc++.h>
using namespace std;
bool isIncreasing(int n, vector<int> nums){
    for(int i=0; i<n-1; i++){
        if(nums[i]> nums[i+1]){
            return false;
        }
    }
    return true;
}

int main() {
	int t,n;
	cin>>t;
	while(t--){
	    cin>>n;
	    vector<int> nums(n);
	    for(int i=0; i<n; i++){
	        cin>>nums[i];
	    }
	    for(int i=0; i<n-1; i++){
	        int sub = min(nums[i], nums[i+1]);
	        nums[i] = nums[i]-sub;
	         nums[i+1] = nums[i+1]-sub;
	         if(isIncreasing(n, nums)){
	             cout<<"YES"<<endl;
	             break;
	         }
	         else if(i==n-2){
	             cout<<"NO"<<endl;
	         }
	    }
	    
	    
	    
	    
	}
    
}
	    

Submission (verdict: Time limit exceeded on test 8):
#include <bits/stdc++.h>
using namespace std;
int main() {
	int t,n;
	cin>>t;
	while(t--){
	    cin>>n;
	    vector<int> nums(n);
	    for(int i=0; i<n; i++){
	        cin>>nums[i];
	    }
	    for(int i=0; i<n-1; i++){
	        int sub = min(nums[i], nums[i+1]);
	        nums[i] = nums[i]-sub;
	         nums[i+1] = nums[i+1]-sub;
	         if(is_sorted(nums.begin(), nums.end())){
	             cout<<"YES"<<endl;
	             break;
	         }
	         else if(i==n-2){
	             cout<<"NO"<<endl;
	         }
	    }
	    
	    
	    
	    
	}
	return 0;
    
}
Problem: 2050C - Uninteresting Number
Language: C++23 (GCC 14-64, msys2)

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



#define int long long



using namespace std;



void solve(){

    string s;

    cin >> s;

    int cnt = 0, cnt2 = 0, sum = 0;

    for (int i = 0; i < s.size(); i++){

        int c = s[i] - '0';

        if (c == 2){

            cnt++;

        }

        else if (c == 3){

            cnt2++;

        }

        sum += c;

    }



    int x = sum % 9;

    if (x == 0){

        cout << "YES\n";

        return;

    }

    while (cnt > 0){

        x += 2;

        if (x % 9 == 0){

            cout << "YES\n";

            return;

        }

        cnt--;

    }

    while (cnt2 > 0){

        x += 6;

        if (x % 9 == 0){

            cout << "YES\n";

            return;

        }

        cnt2--;

    }



    cout << "NO\n";

}



int32_t main(){

    ios_base::sync_with_stdio(0);

    cin.tie(0);

    cout.tie(0);

    int t;

    cin >> t;

    while (t--){

        solve();

    }

    return 0;

}

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



#define int long long



using namespace std;



void solve(){

    string s;

    cin >> s;

    int cnt = 0, cnt2 = 0, sum = 0;

    for (int i = 0; i < s.size(); i++){

        int c = s[i] - '0';

        if (c == 2){

            cnt++;

        }

        else if (c == 3){

            cnt2++;

        }

        sum += c;

    }



    int x = sum % 9;

    if (x == 0){

        cout << "YES\n";

        return;

    }

    while (cnt >= 0){

        x += 2;

        if (x % 9 == 0){

            cout << "YES\n";

            return;

        }

        cnt--;

    }

    while (cnt2 >= 0){

        x += 6;

        if (x % 9 == 0){

            cout << "YES\n";

            return;

        }

        cnt2--;

    }



    cout << "NO\n";

}



int32_t main(){

    ios_base::sync_with_stdio(0);

    cin.tie(0);

    cout.tie(0);

    int t;

    cin >> t;

    while (t--){

        solve();

    }

    return 0;

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

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



#define int long long



using namespace std;



void solve(){

    string s;

    cin >> s;

    int cnt = 0, cnt2 = 0, sum = 0;

    for (int i = 0; i < s.size(); i++){

        int c = s[i] - '0';

        if (c == 2){

            cnt++;

        }

        else if (c == 3){

            cnt2++;

        }

        sum += c;

    }



    int x = sum % 9;

    if (x == 0){

        cout << "YES\n";

        return;

    }

    while (cnt > 0){

        x += 2;

        if (x % 9 == 0){

            cout << "YES\n";

            return;

        }

        cnt--;

    }

    if (x == 0){

        cout << "YES\n";

        return;

    }

    while (cnt2 > 0){

        x += 6;

        if (x % 9 == 0){

            cout << "YES\n";

            return;

        }

        cnt2--;

    }

    if (x == 0){

        cout << "YES\n";

        return;

    }



    cout << "NO\n";

}



int32_t main(){

    ios_base::sync_with_stdio(0);

    cin.tie(0);

    cout.tie(0);

    int t;

    cin >> t;

    while (t--){

        solve();

    }

    return 0;

}

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



#define int long long



using namespace std;



void solve(){

    string s;

    cin >> s;

    int cnt = 0, cnt2 = 0, sum = 0;

    for (int i = 0; i < s.size(); i++){

        int c = s[i] - '0';

        if (c == 2){

            cnt++;

        }

        else if (c == 3){

            cnt2++;

        }

        sum += c;

    }



    int x = sum % 9;

    

    for (int i = 0; i <= min(8ll, cnt); i++){

        for (int j = 0; j <= min(8ll, cnt2); j++){

            if ((2 * i + 6 * j + x) % 9 == 0){

                cout << "YES\n";

                return;

            }

        }

    }

    cout << "NO\n";

}



int32_t main(){

    ios_base::sync_with_stdio(0);

    cin.tie(0);

    cout.tie(0);

    int t;

    cin >> t;

    while (t--){

        solve();

    }

    return 0;

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

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



#define int long long



using namespace std;



void solve(){

    string s;

    cin >> s;

    int cnt = 0, cnt2 = 0, sum = 0;

    for (int i = 0; i < s.size(); i++){

        int c = s[i] - '0';

        if (c == 2){

            cnt++;

        }

        else if (c == 3){

            cnt2++;

        }

        sum += c;

    }



    int x = sum % 9;

    if (x == 0){

        cout << "YES\n";

        return;

    }

    while (cnt >= 0){

        x += 2;

        if (x % 9 == 0){

            cout << "YES\n";

            return;

        }

        cnt--;

    }

    while (cnt2 >= 0){

        x += 6;

        if (x % 9 == 0){

            cout << "YES\n";

            return;

        }

        cnt2--;

    }



    cout << "NO\n";

}



int32_t main(){

    ios_base::sync_with_stdio(0);

    cin.tie(0);

    cout.tie(0);

    int t;

    cin >> t;

    while (t--){

        solve();

    }

    return 0;

}

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



#define int long long



using namespace std;



void solve(){

    string s;

    cin >> s;

    int cnt = 0, cnt2 = 0, sum = 0;

    for (int i = 0; i < s.size(); i++){

        int c = s[i] - '0';

        if (c == 2){

            cnt++;

        }

        else if (c == 3){

            cnt2++;

        }

        sum += c;

    }



    int x = sum % 9;

    if (x == 0){

        cout << "YES\n";

        return;

    }

    while (cnt > 0){

        x += 2;

        if (x % 9 == 0){

            cout << "YES\n";

            return;

        }

        cnt--;

    }

    int x = sum % 9;

    if (x == 0){

        cout << "YES\n";

        return;

    }

    while (cnt2 > 0){

        x += 6;

        if (x % 9 == 0){

            cout << "YES\n";

            return;

        }

        cnt2--;

    }

    int x = sum % 9;

    if (x == 0){

        cout << "YES\n";

        return;

    }



    cout << "NO\n";

}



int32_t main(){

    ios_base::sync_with_stdio(0);

    cin.tie(0);

    cout.tie(0);

    int t;

    cin >> t;

    while (t--){

        solve();

    }

    return 0;

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


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



#define int long long



using namespace std;



void solve(){

    string s;

    cin >> s;

    int cnt = 0, cnt2 = 0, sum = 0;

    for (int i = 0; i < s.size(); i++){

        int c = s[i] - '0';

        if (c == 2){

            cnt++;

        }

        else if (c == 3){

            cnt2++;

        }

        sum += c;

    }



    int x = sum % 9;

    if (x == 0){

        cout << "YES\n";

        return;

    }

    while (cnt > 0){

        x += 2;

        if (x % 9 == 0){

            cout << "YES\n";

            return;

        }

        cnt--;

    }

    while (cnt2 > 0){

        x += 6;

        if (x % 9 == 0){

            cout << "YES\n";

            return;

        }

        cnt2--;

    }



    cout << "NO\n";

}



int32_t main(){

    ios_base::sync_with_stdio(0);

    cin.tie(0);

    cout.tie(0);

    int t;

    cin >> t;

    while (t--){

        solve();

    }

    return 0;

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

Previous submission (verdict: Compilation error):
#include <bits/stdc++.h>



#define int long long



using namespace std;



void solve(){

    string s;

    cin >> s;

    int cnt = 0, cnt2 = 0, sum = 0;

    for (int i = 0; i < s.size(); i++){

        int c = s[i] - '0';

        if (c == 2){

            cnt++;

        }

        else if (c == 3){

            cnt2++;

        }

        sum += c;

    }



    int x = sum % 9;

    if (x == 0){

        cout << "YES\n";

        return;

    }

    while (cnt > 0){

        x += 2;

        if (x % 9 == 0){

            cout << "YES\n";

            return;

        }

        cnt--;

    }

    int x = sum % 9;

    if (x == 0){

        cout << "YES\n";

        return;

    }

    while (cnt2 > 0){

        x += 6;

        if (x % 9 == 0){

            cout << "YES\n";

            return;

        }

        cnt2--;

    }

    int x = sum % 9;

    if (x == 0){

        cout << "YES\n";

        return;

    }



    cout << "NO\n";

}



int32_t main(){

    ios_base::sync_with_stdio(0);

    cin.tie(0);

    cout.tie(0);

    int t;

    cin >> t;

    while (t--){

        solve();

    }

    return 0;

}

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



#define int long long



using namespace std;



void solve(){

    string s;

    cin >> s;

    int cnt = 0, cnt2 = 0, sum = 0;

    for (int i = 0; i < s.size(); i++){

        int c = s[i] - '0';

        if (c == 2){

            cnt++;

        }

        else if (c == 3){

            cnt2++;

        }

        sum += c;

    }



    int x = sum % 9;

    if (x == 0){

        cout << "YES\n";

        return;

    }

    while (cnt > 0){

        x += 2;

        if (x % 9 == 0){

            cout << "YES\n";

            return;

        }

        cnt--;

    }

    if (x == 0){

        cout << "YES\n";

        return;

    }

    while (cnt2 > 0){

        x += 6;

        if (x % 9 == 0){

            cout << "YES\n";

            return;

        }

        cnt2--;

    }

    if (x == 0){

        cout << "YES\n";

        return;

    }



    cout << "NO\n";

}



int32_t main(){

    ios_base::sync_with_stdio(0);

    cin.tie(0);

    cout.tie(0);

    int t;

    cin >> t;

    while (t--){

        solve();

    }

    return 0;

}
Problem: 2052A - Adrenaline Rush
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 4):
/*
  卫风·芄兰
芄兰之支,童子佩觿.
虽则佩觿,能不我知?
容兮遂兮,垂带悸兮.
芄兰之叶,童子佩韘.
虽则佩韘,能不我甲?
容兮遂兮,垂带悸兮.
*/
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define PII pair<int,int>
#define tul array<int,3>
#define rep(i,a,b) for(int i=a;i<=b;++i)
#define rep_(i,a,b) for(int i=a;i>=b;--i)
#define all(x) x.begin(),x.end()
#define bp(x) __builtin_popcountll(x)
#define ctz(x) __builtin_ctzll(x)
#define cy cout<<"YES"<<endl
#define cn cout<<"NO"<<endl
#define lc (rt<<1)
#define rc (rt<<1|1)
mt19937_64 rnd(time(0));
const int N=3e5+5,yyx=998244353;
vector<int> to[N];
int n,m,a[N];
inline int mod(int x){
  return (x%yyx+yyx)%yyx;
}
inline int cmin(int &x,int y){
  return x>y?x=y,1:0;
}
inline int cmax(int &x,int y){
  return x<y?x=y,1:0;
}
inline void solve(){
  cin>>n;
  set<PII> s;
  vector<PII> t;
  rep(i,1,n) cin>>a[i];
  rep(i,1,n){
    rep(j,1,i-1){
        if(a[j]<a[i]) s.insert({a[i],a[j]}),s.insert({a[j],a[i]});
        else s.insert({a[j],a[i]});
    }
  }
  cout<<s.size()<<endl;
  for(auto [x,y]:s) t.push_back({x,y});
  sort(all(t),[&](PII x,PII y){
    return x.second==y.second?x.first<y.first:x.second<y.second;
  });
  for(auto [x,y]:t) cout<<x<<" "<<y<<endl;
}
signed main(){
  cin.tie(0)->sync_with_stdio(0);
  //freopen("D://321//in.txt","r",stdin);
  //freopen("D://321//out.txt","w",stdout);
  int _=1;
  //cin>>_;
  while(_--)
  solve();
  return 0;
}

Submission (verdict: Wrong answer on test 7):
/*
  卫风·芄兰
芄兰之支,童子佩觿.
虽则佩觿,能不我知?
容兮遂兮,垂带悸兮.
芄兰之叶,童子佩韘.
虽则佩韘,能不我甲?
容兮遂兮,垂带悸兮.
*/
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define PII pair<int,int>
#define tul array<int,3>
#define rep(i,a,b) for(int i=a;i<=b;++i)
#define rep_(i,a,b) for(int i=a;i>=b;--i)
#define all(x) x.begin(),x.end()
#define bp(x) __builtin_popcountll(x)
#define ctz(x) __builtin_ctzll(x)
#define cy cout<<"YES"<<endl
#define cn cout<<"NO"<<endl
#define lc (rt<<1)
#define rc (rt<<1|1)
mt19937_64 rnd(time(0));
const int N=3e5+5,yyx=998244353;
vector<PII> to[N];
int n,m,a[N];
inline int mod(int x){
  return (x%yyx+yyx)%yyx;
}
inline int cmin(int &x,int y){
  return x>y?x=y,1:0;
}
inline int cmax(int &x,int y){
  return x<y?x=y,1:0;
}
inline void solve(){
  cin>>n;
  set<PII> s;
  map<int,vector<int>> t;
  queue<int> q;
  rep(i,1,n) cin>>a[i],q.push(a[i]);
  rep(i,1,n){
    rep(j,1,i-1){
        if(a[j]<a[i]) s.insert({a[i],a[j]}),s.insert({a[j],a[i]});
        else s.insert({a[j],a[i]});
    }
  }
  cout<<s.size()<<endl;
  for(auto [x,y]:s){
    if(y<x) t[x].push_back(y);
  }
  rep_(i,n,1){
    sort(all(t[i]),greater<int>());
  }
  rep_(i,n,1){
    for(auto c:t[i]) cout<<i<<" "<<c<<endl;
    rep(j,1,i-1){
        if(s.count({j,i})) t[j].push_back(i);
    }
  }
}
signed main(){
  cin.tie(0)->sync_with_stdio(0);
  //freopen("D://321//in.txt","r",stdin);
  //freopen("D://321//out.txt","w",stdout);
  int _=1;
  //cin>>_;
  while(_--)
  solve();
  return 0;
}
Problem: 2052A - Adrenaline Rush
Language: C++20 (GCC 13-64)


Submission (verdict: Wrong answer on test 4):
/*
  卫风·芄兰
芄兰之支,童子佩觿.
虽则佩觿,能不我知?
容兮遂兮,垂带悸兮.
芄兰之叶,童子佩韘.
虽则佩韘,能不我甲?
容兮遂兮,垂带悸兮.
*/
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define PII pair<int,int>
#define tul array<int,3>
#define rep(i,a,b) for(int i=a;i<=b;++i)
#define rep_(i,a,b) for(int i=a;i>=b;--i)
#define all(x) x.begin(),x.end()
#define bp(x) __builtin_popcountll(x)
#define ctz(x) __builtin_ctzll(x)
#define cy cout<<"YES"<<endl
#define cn cout<<"NO"<<endl
#define lc (rt<<1)
#define rc (rt<<1|1)
mt19937_64 rnd(time(0));
const int N=3e5+5,yyx=998244353;
vector<int> to[N];
int n,m,a[N];
inline int mod(int x){
  return (x%yyx+yyx)%yyx;
}
inline int cmin(int &x,int y){
  return x>y?x=y,1:0;
}
inline int cmax(int &x,int y){
  return x<y?x=y,1:0;
}
inline void solve(){
  cin>>n;
  set<PII> s;
  vector<PII> t;
  rep(i,1,n) cin>>a[i];
  rep(i,1,n){
    rep(j,1,i-1){
        if(a[j]<a[i]) s.insert({a[i],a[j]}),s.insert({a[j],a[i]});
        else s.insert({a[j],a[i]});
    }
  }
  cout<<s.size()<<endl;
  for(auto [x,y]:s) t.push_back({x,y});
  sort(all(t),[&](PII x,PII y){
    return x.second==y.second?x.first<y.first:x.second<y.second;
  });
  for(auto [x,y]:t) cout<<x<<" "<<y<<endl;
}
signed main(){
  cin.tie(0)->sync_with_stdio(0);
  //freopen("D://321//in.txt","r",stdin);
  //freopen("D://321//out.txt","w",stdout);
  int _=1;
  //cin>>_;
  while(_--)
  solve();
  return 0;
}
Problem: 2049C - MEX Cycle
Language: C++20 (GCC 13-64)


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

using namespace std;



#define sws std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

#define int long long int

#define float long double

#define ld long double

#define ll long long

#define pb push_back

#define ff first

#define ss second

#define vi vector<int>

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

#define vvi vector<vector<int>>

#define pii pair<int, int>

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

#define rall(x) x.rbegin(), x.rend()

#define in(v) for(auto & x : v) cin >> x;

#define out(v) for(auto x : v) cout << x << ' ';

#define tiii tuple<int, int, int>

#define tam(x) ((int)x.size())



const int MAX = 3e5+1;

const int INF = INT32_MAX;

int MOD = 1e9+7;

const int LOG = 31;

const ld PI = acos(-1);

const int MINF = INT32_MIN;

vpii dirs = {{1, 0}, {-1, 0}};

vpii dirs1 = {{0, 1}, {0, -1}};



// Contest patrocinado por Summer

// meu primeiro amor santos queridooooooo



void solve() {



    int n, x, y; cin >> n >> x >> y;



    x--; y--;



    vi ans(n, -1);



    if(n % 2){



        ans[x] = 2;

    

        int start = 1;

    

        for(int i = (x + 1) % n; ans[i] == -1; (i+=1)%=n){

    

            ans[i] = start;

    

            start = !(start == 1);

        }



        cout << '\n';

        out(ans);

        cout << '\n';

        return;

    }



    if(x % 2 == y % 2) {ans[x] = 2; ans[y] = 3;}



    int start = 1, iniPoint = x;



    if(y - x - 1 == 1){



        ans[x + 1] = 0;

        iniPoint = y;

    }

    

    for(int i = (iniPoint + 1) % n; ans[i] > 2 || ans[i] == -1; (i+=1)%=n){



        if(ans[i] != -1) continue;

        ans[i] = start;



        start = !(start == 1);

    }



    cout << '\n';



    out(ans);

    cout << '\n';

}



int32_t main() { 

    sws;

    int t = 1;

    cin >> t;



    while(t--)

        solve();



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> 
#define ll long long
#define newl <<'\n'
#define newt <<'\t'
#define news <<' '
#define forn(n,i) for(ll i = 0;i<n;i++)
#define forr(n,k,i) for(ll i = k;i<n;i++)
#define for2(n,k) for(int j = k;j<n;j++)
#define for3(n,k) for(int j = n;j>=k;j--)
#define modd 1000000007
#define mo 998244353
#define llp unsigned long long
#define pb push_back
#define get(a) ll a;cin>>a;
#define all(a) a.begin(),a.end()
using namespace std;
typedef vector < ll > vi;
typedef vector < bool > vb;
typedef vector < vi > vvi;
typedef pair < ll, ll > ii; 
typedef vector < ii > vii;
typedef set <ll> sat;
typedef multiset <ll> msat;
llp power(llp a,llp b)
{
    a%=modd;
    llp res = 1;
    while(b>0)
    { 
        if(b&1)res=(res*a + modd)%modd;
        a=(a*a + modd)%modd;b>>=1;
    }
    return res;
}

void solve()
{
    ll l,r;
    cin >> l >> r;
    ll t = 1,ct = 0;
    ll a = 0,b = 0;
    while(t<r)t<<=1,++ct;
    while(ct)
    {
        if(t&(r&l)){
            a+=t,b+=t;
        }
        else{
            a+=t;
            b+=t-1;
            break;
        }
        --ct;t>>=1;
    }
    for(int i = l;i<=r;++i)
    {
        if(i!=a&&i!=b)
        {
            cout << a news << i news << b newl;
            break;
        }
    }
}

int main(void)
{   
//    freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
    ll tc = 1;
    cin>>tc;
    while(tc--)
    {
        solve();    
    }
    
    

}

Submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h> 
#define ll long long
#define newl <<'\n'
#define newt <<'\t'
#define news <<' '
#define forn(n,i) for(ll i = 0;i<n;i++)
#define forr(n,k,i) for(ll i = k;i<n;i++)
#define for2(n,k) for(int j = k;j<n;j++)
#define for3(n,k) for(int j = n;j>=k;j--)
#define modd 1000000007
#define mo 998244353
#define llp unsigned long long
#define pb push_back
#define get(a) ll a;cin>>a;
#define all(a) a.begin(),a.end()
using namespace std;
typedef vector < ll > vi;
typedef vector < bool > vb;
typedef vector < vi > vvi;
typedef pair < ll, ll > ii; 
typedef vector < ii > vii;
typedef set <ll> sat;
typedef multiset <ll> msat;
llp power(llp a,llp b)
{
    a%=modd;
    llp res = 1;
    while(b>0)
    { 
        if(b&1)res=(res*a + modd)%modd;
        a=(a*a + modd)%modd;b>>=1;
    }
    return res;
}

void solve()
{
    ll l,r;
    cin >> l >> r;
    ll t = 1,ct = 0;
    ll a = 0,b = 0;
    while(2*t<=r)t<<=1,++ct;
    while(ct)
    {
        if(t&(r&l)){
            a+=t,b+=t;
        }
        else{
            a+=t;
            b+=t-1;
            break;
        }
        --ct;t>>=1;
    }
    for(int i = l;i<=r;++i)
    {
        if(i!=a&&i!=b)
        {
            cout << a news << i news << b newl;
            break;
        }
    }
}

int main(void)
{   
//    freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
    ll tc = 1;
    cin>>tc;
    while(tc--)
    {
        solve();    
    }
    
    

}
Problem: 2057C - Trip to the Olympiad
Language: C++23 (GCC 14-64, msys2)


Submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h> 
#define ll long long
#define newl <<'\n'
#define newt <<'\t'
#define news <<' '
#define forn(n,i) for(ll i = 0;i<n;i++)
#define forr(n,k,i) for(ll i = k;i<n;i++)
#define for2(n,k) for(int j = k;j<n;j++)
#define for3(n,k) for(int j = n;j>=k;j--)
#define modd 1000000007
#define mo 998244353
#define llp unsigned long long
#define pb push_back
#define get(a) ll a;cin>>a;
#define all(a) a.begin(),a.end()
using namespace std;
typedef vector < ll > vi;
typedef vector < bool > vb;
typedef vector < vi > vvi;
typedef pair < ll, ll > ii; 
typedef vector < ii > vii;
typedef set <ll> sat;
typedef multiset <ll> msat;
llp power(llp a,llp b)
{
    a%=modd;
    llp res = 1;
    while(b>0)
    { 
        if(b&1)res=(res*a + modd)%modd;
        a=(a*a + modd)%modd;b>>=1;
    }
    return res;
}

void solve()
{
    ll l,r;
    cin >> l >> r;
    ll t = 1,ct = 0;
    ll a = 0,b = 0;
    while(t<r)t<<=1,++ct;
    while(ct)
    {
        if(t&(r&l)){
            a+=t,b+=t;
        }
        else{
            t>>=1;
            a+=t;
            b+=t-1;
            break;
        }
        --ct;t>>=1;
    }
    for(int i = l;i<=r;++i)
    {
        if(i!=a&&i!=b)
        {
            cout << a news << i news << b newl;
            break;
        }
    }
}

int main(void)
{   
//    freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
    ll tc = 1;
    cin>>tc;
    while(tc--)
    {
        solve();    
    }
    
    

}