ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2050E - Three Strings
Language: C++20 (GCC 13-64)

Previous submission (verdict: Runtime error on test 6):
#include<bits/stdc++.h>


using namespace std;
typedef long long LL;
#define int long long
typedef pair<int,int> PII;	
const int N=2000010;
int a[N],res[N],res2[N];
	int n,m;
void solve(){
	string a,b,x;
	cin>>a>>b>>x;
	x="."+x;
	a="."+a;
	b="."+b;
	std::vector<vector<int>>dp(a.size()+10,vector<int>(b.size()+10,1e18));
	int n=x.size();
	dp[0][0]=0;
	for(int i=1;i<n;i++){
		// if(i<b.size())dp[0][i]=min(dp[0][i],dp[0][i-1]+(b[i]!=x[i]));
		for(int j=1;j<=min(i,(int)a.size()-1);j++){
			dp[j][i-j]=min(dp[j][i-j],dp[j-1][i-j]+1);
			if(x[i]==a[j]){
				dp[j][i-j]=min(dp[j][i-j],dp[j-1][i-j]);
			}

		}
		for(int j=1;j<=min(i,(int)b.size()-1);j++){
			dp[i-j][j]=min(dp[i-j][j],dp[i-j][j-1]+1);
			if(x[i]==b[j]){
				dp[i-j][j]=min(dp[i-j][j],dp[i-j][j-1]);
			}

		}
		// cout<<dp[0][1]<<" "<<dp[1][0]<<"\n";
	}
	cout<<dp[a.size()-1][b.size()-1]<<"\n";
}
signed main(){
	 ios::sync_with_stdio(0);
    cin.tie(0) , cout.tie(0);
    int t=1;
    cin>>t;
    while(t--)
    {
        solve();
    }
}


Submission (verdict: Runtime error on test 6):
#include<bits/stdc++.h>


using namespace std;
typedef long long LL;
#define int long long
typedef pair<int,int> PII;	
const int N=2000010;
void solve(){
	string a,b,x;
	cin>>a>>b>>x;
	x="."+x;
	a="."+a;
	b="."+b;
	std::vector<vector<int>>dp(a.size()+10,vector<int>(b.size()+10,1e18));
	int n=x.size();
	dp[0][0]=0;
	for(int i=1;i<n;i++){
		// if(i<b.size())dp[0][i]=min(dp[0][i],dp[0][i-1]+(b[i]!=x[i]));
		for(int j=1;j<=min(i,(int)a.size()-1);j++){
			dp[j][i-j]=min(dp[j][i-j],dp[j-1][i-j]+1);
			if(x[i]==a[j]){
				dp[j][i-j]=min(dp[j][i-j],dp[j-1][i-j]);
			}

		}
		for(int j=1;j<=min(i,(int)b.size()-1);j++){
			dp[i-j][j]=min(dp[i-j][j],dp[i-j][j-1]+1);
			if(x[i]==b[j]){
				dp[i-j][j]=min(dp[i-j][j],dp[i-j][j-1]);
			}

		}
		// cout<<dp[0][1]<<" "<<dp[1][0]<<"\n";
	}
	cout<<dp[a.size()-1][b.size()-1]<<"\n";
}
signed main(){
	 ios::sync_with_stdio(0);
    cin.tie(0) , cout.tie(0);
    int t=1;
    cin>>t;
    while(t--)
    {
        solve();
    }
}
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;

long long max(long long a, long long b){
    return (a>b)?a:b;
}

long long min(long long a, long long b){
    return (a<b)?a:b;
}

int max(int a, int b){
    return (a>b)?a:b;
}

int min(int a, int b){
    return (a<b)?a:b;
}



void soln(){
    long long l, r, a, b, c, d, n, p, q;
    cin>>l>>r;
    d = 0;
    int i;
    n = 1;
    for(i = 30; i>=1; i--){
        p = r&(n<<i);
        q = l&(n<<i);
        // cout<<q<<" "<<p<<endl;
        if(p == q){
            // cout<<"here"<<endl;
            if(l&(n<<i)){
                d = d|(n<<i);
            }
        }
        else break;
        // cout<<d<<endl;
    }
    a = d|(n<<i);
    b = a-1;
    if(r>a) c = a+1;
    else c = a-2;
    cout<<a<<" "<<b<<" "<<c<<endl;



    
}

int main()
{
    int t;
    cin >> t;
    for (int i = 0; i < t; i++)
        soln();
}




Submission (verdict: Accepted):
#include <bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
const ll N = 2e5 + 10, LG = 20, mod = 1e9 + 7;

void burn()
{
    int l, r;
    cin >> l >> r;
    int xr = l^r;
    int msb = 31 - __builtin_clz(xr);
    int a = (((1 << msb) - 1) | l), b = a + 1, c = (a == l ? r : l);
    cout << a << ' ' << b << ' ' << c << '\n';
}

signed main()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int t = 1;
      cin >> t;
    while (t--)
        burn();
}
Problem: 2057C - Trip to the Olympiad
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Runtime error on test 2):
// Problem: C. Trip to the Olympiad
// Contest: Codeforces - Hello 2025
// URL: https://codeforces.com/problemset/problem/2057/C
// Memory Limit: 256 MB
// Time Limit: 2000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include<iostream>
#include<string>
#include<vector>
#include<climits>
#include<algorithm>
#include<iomanip>
#include<map>
#include<cmath>
#include<set>
using namespace std;
#define int long long
#define read(a,n) for(int i=0;i<n;i++) cin >> a[i];
int mod = 1e9+7;
string bin(int n){
	string s="";
	while(n>0){
		s+=to_string(n%2);
		n/=2;
	}
	reverse(s.begin(),s.end());
	return s;
}
void solve(){
	int l,r;
	cin>>l>>r;
	int a,b,c;
	string s,t;
	s=bin(l);
	t=bin(r);
	int n,m;
	n=t.size();
	m=s.size();
	if(n>m){
		a=pow(2,n-1);
		b=a-1;
		if(a+1<=r) c=a+1;
		else c=b-1;
		cout<<a<<" "<<b<<" "<<c<<endl;
	}else {
		a=r;
		b=l;
		c=l+1;
		cout<<a<<" "<<b<<" "<<c<<endl;
	}
}
int32_t main()
{
	ios_base::sync_with_stdio(false); cin.tie(NULL); 
	int t;
	cin >> t;
	while(t--){
		solve();
	}
}

Submission (verdict: Wrong answer on test 2):
// Problem: C. Trip to the Olympiad
// Contest: Codeforces - Hello 2025
// URL: https://codeforces.com/problemset/problem/2057/C
// Memory Limit: 256 MB
// Time Limit: 2000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include<iostream>
#include<string>
#include<vector>
#include<climits>
#include<algorithm>
#include<iomanip>
#include<map>
#include<cmath>
#include<set>
using namespace std;
#define int long long
#define read(a,n) for(int i=0;i<n;i++) cin >> a[i];
int mod = 1e9+7;
string bin(int n){
	string s="";
	while(n>0){
		s+=to_string(n%2);
		n/=2;
	}
	reverse(s.begin(),s.end());
	return s;
}
int func(int a, int b, int c){
	int ans = (a xor b)+ (a xor c) + (b xor c);
	return ans;
}
void solve(){
	int l,r;
	cin>>l>>r;
	int a,b,c;
	string s,t;
	s=bin(l);
	t=bin(r);
	int n,m;
	n=t.size();
	m=s.size();
	if(n > m){
		a = pow(2,n-1);
		b = a-1;
		if(a+1 <= r) c = a+1;
		else c = b-1;
		cout<< a << " " << b << " " << c << endl;
	}else {
		int sum=0,i=0,j=0,p;
		while(i<n){
			if(s[i]==t[j]){
				if(s[i]=='1') sum+=pow(2,n-i-1);
				i++;
				j++;
			}else{
				p=n-i-1;
				break;
			}
		}
		//cout<<p<<" "<<sum<<endl;
		a = pow(2,p);
		b = a-1;
		if(a+1+sum <= r) c=a+1;
		else c=b-1;
		cout<<sum+a<<" "<<b+sum<<" "<<c+sum<<endl;
	}
	//cout << func(136, 135, 137) << endl;
	
}
int32_t main()
{
	ios_base::sync_with_stdio(false); cin.tie(NULL); 
	int t;
	cin >> t;
	while(t--){
		solve();
	}
}
Problem: 2057C - Trip to the Olympiad
Language: C++23 (GCC 14-64, msys2)


Submission (verdict: Wrong answer on test 2):
// Problem: C. Trip to the Olympiad
// Contest: Codeforces - Hello 2025
// URL: https://codeforces.com/problemset/problem/2057/C
// Memory Limit: 256 MB
// Time Limit: 2000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include<iostream>
#include<string>
#include<vector>
#include<climits>
#include<algorithm>
#include<iomanip>
#include<map>
#include<cmath>
#include<set>
using namespace std;
#define int long long
#define read(a,n) for(int i=0;i<n;i++) cin >> a[i];
int mod = 1e9+7;
string bin(int n){
	string s="";
	while(n>0){
		s+=to_string(n%2);
		n/=2;
	}
	reverse(s.begin(),s.end());
	return s;
}
void solve(){
	int l,r;
	cin>>l>>r;
	int a,b,c;
	string s,t;
	s=bin(l);
	t=bin(r);
	int n,m;
	n=t.size();
	m=s.size();
	if(n>m){
		a=pow(2,n-1);
		b=a-1;
		c=l;
		cout<<a<<" "<<b<<" "<<c<<endl;
	}else {
		a=r;
		b=l;
		c=l+1;
		cout<<a<<" "<<b<<" "<<c<<endl;
	}
}
int32_t main()
{
	ios_base::sync_with_stdio(false); cin.tie(NULL); 
	int t;
	cin >> t;
	while(t--){
		solve();
	}
}
Problem: 2057C - Trip to the Olympiad
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 2):
// Problem: C. Trip to the Olympiad
// Contest: Codeforces - Hello 2025
// URL: https://codeforces.com/problemset/problem/2057/C
// Memory Limit: 256 MB
// Time Limit: 2000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include<iostream>
#include<string>
#include<vector>
#include<climits>
#include<algorithm>
#include<iomanip>
#include<map>
#include<cmath>
#include<set>
using namespace std;
#define int long long
#define read(a,n) for(int i=0;i<n;i++) cin >> a[i];
int mod = 1e9+7;
string bin(int n){
	string s="";
	while(n>0){
		s+=to_string(n%2);
		n/=2;
	}
	reverse(s.begin(),s.end());
	return s;
}
int func(int a, int b, int c){
	int ans = (a xor b)+ (a xor c) + (b xor c);
	return ans;
}
void solve(){
	int l,r;
	cin>>l>>r;
	int a,b,c;
	string s,t;
	s=bin(l);
	t=bin(r);
	int n,m;
	n=t.size();
	m=s.size();
	if(n > m){
		a = pow(2,n-1);
		b = a-1;
		if(a+1 <= r) c = a+1;
		else c = b-1;
		cout<< a << " " << b << " " << c << endl;
	}else {
		int sum=0,i=0,j=0,p;
		while(i<n){
			if(s[i]==t[j]){
				if(s[i]=='1') sum+=pow(2,n-i-1);
				i++;
				j++;
			}else{
				p=n-i-1;
				break;
			}
		}
		//cout<<p<<" "<<sum<<endl;
		a = pow(2,p);
		b = a-1;
		if(a+1+sum <= r) c=a+1;
		else c=b-1;
		cout<<sum+a<<" "<<b+sum<<" "<<c+sum<<endl;
	}
	//cout << func(136, 135, 137) << endl;
	
}
int32_t main()
{
	ios_base::sync_with_stdio(false); cin.tie(NULL); 
	int t;
	cin >> t;
	while(t--){
		solve();
	}
}

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

long long max(long long a, long long b){
    return (a>b)?a:b;
}

long long min(long long a, long long b){
    return (a<b)?a:b;
}

int max(int a, int b){
    return (a>b)?a:b;
}

int min(int a, int b){
    return (a<b)?a:b;
}



void soln(){
    long long l, r, a, b, c, d, n, p, q;
    cin>>l>>r;
    d = 0;
    int i;
    n = 1;
    for(i = 30; i>=1; i--){
        p = r&(n<<i);
        q = l&(n<<i);
        // cout<<q<<" "<<p<<endl;
        if(p == q){
            // cout<<"here"<<endl;
            if(l&(n<<i)){
                d = d|(n<<i);
            }
        }
        else break;
        // cout<<d<<endl;
    }
    a = d|(n<<i);
    b = a-1;
    if(r>a) c = a+1;
    else c = a-2;
    cout<<a<<" "<<b<<" "<<c<<endl;



    
}

int main()
{
    int t;
    cin >> t;
    for (int i = 0; i < t; i++)
        soln();
}
Problem: 2057C - Trip to the Olympiad
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 2):
// Problem: C. Trip to the Olympiad
// Contest: Codeforces - Hello 2025
// URL: https://codeforces.com/problemset/problem/2057/C
// Memory Limit: 256 MB
// Time Limit: 2000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include<iostream>
#include<string>
#include<vector>
#include<climits>
#include<algorithm>
#include<iomanip>
#include<map>
#include<cmath>
#include<set>
using namespace std;
#define int long long
#define read(a,n) for(int i=0;i<n;i++) cin >> a[i];
int mod = 1e9+7;
string bin(int n){
	string s="";
	while(n>0){
		s+=to_string(n%2);
		n/=2;
	}
	reverse(s.begin(),s.end());
	return s;
}
void solve(){
	int l,r;
	cin>>l>>r;
	int a,b,c;
	string s,t;
	s=bin(l);
	t=bin(r);
	int n,m;
	n=t.size();
	m=s.size();
	if(n>m){
		a=pow(2,n-1);
		b=a-1;
		c=l;
		cout<<a<<" "<<b<<" "<<c<<endl;
	}else {
		a=r;
		b=l;
		c=l+1;
		cout<<a<<" "<<b<<" "<<c<<endl;
	}
}
int32_t main()
{
	ios_base::sync_with_stdio(false); cin.tie(NULL); 
	int t;
	cin >> t;
	while(t--){
		solve();
	}
}

Submission (verdict: Runtime error on test 2):
// Problem: C. Trip to the Olympiad
// Contest: Codeforces - Hello 2025
// URL: https://codeforces.com/problemset/problem/2057/C
// Memory Limit: 256 MB
// Time Limit: 2000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include<iostream>
#include<string>
#include<vector>
#include<climits>
#include<algorithm>
#include<iomanip>
#include<map>
#include<cmath>
#include<set>
using namespace std;
#define int long long
#define read(a,n) for(int i=0;i<n;i++) cin >> a[i];
int mod = 1e9+7;
string bin(int n){
	string s="";
	while(n>0){
		s+=to_string(n%2);
		n/=2;
	}
	reverse(s.begin(),s.end());
	return s;
}
void solve(){
	int l,r;
	cin>>l>>r;
	int a,b,c;
	string s,t;
	s=bin(l);
	t=bin(r);
	int n,m;
	n=t.size();
	m=s.size();
	if(n>m){
		a=pow(2,n-1);
		b=a-1;
		if(a+1<=r) c=a+1;
		else c=b-1;
		cout<<a<<" "<<b<<" "<<c<<endl;
	}else {
		a=r;
		b=l;
		c=l+1;
		cout<<a<<" "<<b<<" "<<c<<endl;
	}
}
int32_t main()
{
	ios_base::sync_with_stdio(false); cin.tie(NULL); 
	int t;
	cin >> t;
	while(t--){
		solve();
	}
}
Problem: 2063C - Remove Exactly Two
Language: C++23 (GCC 14-64, msys2)


Submission (verdict: Wrong answer on test 1):
#include<bits/stdc++.h>
using namespace std;
#define int long long
int n;
vector<int>v[200005];
int mxe=0,mxi=0;
bool vis[200005];
void dfs1(int i,int p)
{
    vis[i]=1;
    if(v[i].size()>=mxe)mxe=v[i].size(),mxi=i;
    for(auto j:v[i])
    {
        if(j!=p)dfs1(j,i);
    }
}
void dfs_rem(int i,int p)
{
    vis[i]=1;
    if(i == mxi)
    {
        for(auto j:v[i])
        {
            v[j].erase(find(v[j].begin(),v[j].end(),i));
        }
        v[i].clear();
        return;
    }
    for(auto j:v[i])
    {
        if(j!=p)dfs_rem(j,i);
    }
}
int32_t main()
{
    int t;
    cin>>t;
    while(t--)
    {
        cin>>n;
        for(int i=1;i<n;i++)
        {
            vis[i]=0;
            int x,y;
            cin>>x>>y;
            v[x].push_back(y);
            v[y].push_back(x);
        }
        mxe=0,mxi=0;
        dfs1(1,0);
        dfs_rem(1,0);

        int mxi2=mxi;
        mxe=0,mxi=0;
        for(int i=1;i<=n;i++)vis[i]=0;
        for(int i=1;i<=n;i++)
        {
            if(!vis[i] && i!=mxi2)
            {
                dfs1(i,0);
            }
        }
      //  cout<<mxi<<endl;
        for(int i=1;i<=n;i++)vis[i]=0;
        for(int i=1;i<=n;i++)
        {
            if(!vis[i] && i!=mxi2)
            {
                dfs_rem(i,0);
            }

        }
        int c=0;
        for(int i=1;i<=n;i++)vis[i]=0;
        for(int i=1;i<=n;i++)
        {
            if(!vis[i] && i!=mxi && i!=mxi2)
            {
                dfs1(i,0);
                c++;
            }
        }
        cout<<c<<endl;

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


Submission (verdict: Wrong answer on test 1):
#include<iostream>
#include<vector>
#include<cstring>
#include<algorithm>
#include<cstdio>
#include<queue>
#include<string.h>
#include <string>
#include<math.h>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<deque>
#include<functional>
using namespace std;

//#define int long long
#define ll long long
#define PA pair<ll,ll>
#define MAXN 100100


void solve() {
	ll l, r; cin >> l >> r;
	ll b = l;

	function<bool(ll)>check = [&](ll num)->bool {
		return num >= l && num <= r;
	};

	bool w = false;
	for (int i = 30; i >= 0; i--) {
		if ((l & (1 << i)) != (r & (1 << i))) {
			
		}
		else {
			if(check(b^(1<<i)))
				b = b ^ (1 << i);
		}
	}

	cout << l << " " << b << " " << r << endl;
}

signed main() {
	int t = 1; cin >> t;
	while (t--) {
		solve();
	}
}
Problem: 2057C - Trip to the Olympiad
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 1):
#include<iostream>
#include<vector>
#include<cstring>
#include<algorithm>
#include<cstdio>
#include<queue>
#include<string.h>
#include <string>
#include<math.h>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<deque>
#include<functional>
using namespace std;

//#define int long long
#define ll long long
#define PA pair<ll,ll>
#define MAXN 100100


void solve() {
	ll l, r; cin >> l >> r;
	ll b = l;

	function<bool(ll)>check = [&](ll num)->bool {
		return num >= l && num <= r;
	};

	bool w = false;
	for (int i = 30; i >= 0; i--) {
		if ((l & (1 << i)) != (r & (1 << i))) {
			
		}
		else {
			if(check(b^(1<<i)))
				b = b ^ (1 << i);
		}
	}

	cout << l << " " << b << " " << r << endl;
}

signed main() {
	int t = 1; cin >> t;
	while (t--) {
		solve();
	}
}



Submission (verdict: Wrong answer on test 1):
#include<iostream>
#include<vector>
#include<cstring>
#include<algorithm>
#include<cstdio>
#include<queue>
#include<string.h>
#include <string>
#include<math.h>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<deque>
#include<functional>
using namespace std;

//#define int long long
#define ll long long
#define PA pair<ll,ll>
#define MAXN 100100


void solve() {
	ll l, r; cin >> l >> r;
	ll b = l;

	function<bool(ll)>check = [&](ll num)->bool {
		return num >= l && num <= r;
	};

	bool w = false;
	for (int i = 30; i >= 0; i--) {
		if (check(1 << i)) {
			cout << (1 << i) - 1 << " " << (1 << i) << " " << (((1 << i) - 1) == l ? r : l) << endl;
			return;
		}
	}

	//cout << l << " " << b << " " << r << endl;
}

signed main() {
	int t = 1; cin >> t;
	while (t--) {
		solve();
	}
}
Problem: 2057C - Trip to the Olympiad
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 1):
#include<iostream>
#include<vector>
#include<cstring>
#include<algorithm>
#include<cstdio>
#include<queue>
#include<string.h>
#include <string>
#include<math.h>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<deque>
#include<functional>
using namespace std;

//#define int long long
#define ll long long
#define PA pair<ll,ll>
#define MAXN 100100


void solve() {
	ll l, r; cin >> l >> r;
	ll b = l;

	function<bool(ll)>check = [&](ll num)->bool {
		return num >= l && num <= r;
	};

	bool w = false;
	for (int i = 30; i >= 0; i--) {
		if (check(1 << i)) {
			cout << (1 << i) - 1 << " " << (1 << i) << " " << (((1 << i) - 1) == l ? r : l) << endl;
			return;
		}
	}

	//cout << l << " " << b << " " << r << endl;
}

signed main() {
	int t = 1; cin >> t;
	while (t--) {
		solve();
	}
}



Submission (verdict: Accepted):
#include<iostream>
#include<vector>
#include<cstring>
#include<algorithm>
#include<cstdio>
#include<queue>
#include<string.h>
#include <string>
#include<math.h>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<deque>
#include<functional>
using namespace std;

//#define int long long
#define ll long long
#define PA pair<ll,ll>
#define MAXN 100100


void solve() {
	ll 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 << "\n";
}

signed main() {
	int t = 1; cin >> t;
	while (t--) {
		solve();
	}
}
Problem: 2057C - Trip to the Olympiad
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
 
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 << "\n";
}
 
signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
 
    int t = 1;
    cin >> t;
 
    while (t--) {
        solve();
    }
}

Submission (verdict: Wrong answer on test 1):
#include<bits/stdc++.h>
using namespace std;
int main(){
    int t;
	cin >> t;
	while(t--){
		long long a,b;
		cin >> a >> b;
		long long i = 1;
		while(i <= b)
			i *= 2;
		i /= 2;
		if(i <= a){
			long long tt = 1;
			while(i + tt <= b)
				tt *= 2;
			tt /= 2;
			cout << i << " " << i + tt << " " << i + tt - 1;
		}
		else{
			cout << i << " " << i - 1 << " ";
			if(b == i - 1)
				cout << i + 1;
			else
				cout << i - 2;
		}
		cout << endl;
	} 
}
Problem: 2057C - Trip to the Olympiad
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 1):
#include<bits/stdc++.h>
using namespace std;
int main(){
    int t;
	cin >> t;
	while(t--){
		long long a,b;
		cin >> a >> b;
		long long i = 1;
		while(i <= b)
			i *= 2;
		i /= 2;
		if(i <= a){
			long long tt = 1;
			while(i + tt <= b)
				tt *= 2;
			tt /= 2;
			cout << i << " " << i + tt << " " << i + tt - 1;
		}
		else{
			cout << i << " " << i - 1 << " ";
			if(a == i - 1)
				cout << i + 1;
			else
				cout << i - 2;
		}
		cout << endl;
	} 
}

Submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
 
using i64 = long long;
 
void solve() {
    int l, r;
    std::cin >> l >> r;
    int k = 31 - __builtin_clz(l ^ r);
    int a = l | ((1 << k) - 1), b = a + 1, c = (a == l ? r : l);
    std::cout << a << " " << b << " " << c << "\n";
}
 
signed main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
 
    int t = 1;
    std::cin >> t;
 
    while (t--) {
        solve();
    }
}
Problem: 2057C - Trip to the Olympiad
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 1):
#include<bits/stdc++.h>
using namespace std;
int main(){
    int t;
	cin >> t;
	while(t--){
		long long a,b;
		cin >> a >> b;
		long long i = 1;
		while(i <= b)
			i *= 2;
		i /= 2;
		if(i <= a){
			long long tt = 1;
			while(i + tt <= b)
				tt *= 2;
			tt /= 2;
			cout << i << " " << i + tt << " " << i + tt - 1;
		}
		else{
			cout << i << " " << i - 1 << " ";
			if(b == i - 1)
				cout << i + 1;
			else
				cout << i - 2;
		}
		cout << endl;
	} 
}

Submission (verdict: Wrong answer on test 1):
#include<bits/stdc++.h>
using namespace std;
int main(){
    int t;
	cin >> t;
	while(t--){
		long long a,b;
		cin >> a >> b;
		long long i = 1;
		while(i <= b)
			i *= 2;
		i /= 2;
		if(i <= a){
			long long tt = 1;
			while(i + tt <= b)
				tt *= 2;
			tt /= 2;
			cout << i << " " << i + tt << " " << i + tt - 1;
		}
		else{
			cout << i << " " << i - 1 << " ";
			if(a == i - 1)
				cout << i + 1;
			else
				cout << i - 2;
		}
		cout << endl;
	} 
}
Problem: 2057C - Trip to the Olympiad
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
 
using i64 = long long;
 
void solve() {
    int l, r;
    std::cin >> l >> r;
    int k = 31 - __builtin_clz(l ^ r);
    int a = l | ((1 << k) - 1), b = a + 1, c = (a == l ? r : l);
    std::cout << a << " " << b << " " << c << "\n";
}
 
signed main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
 
    int t = 1;
    std::cin >> t;
 
    while (t--) {
        solve();
    }
}

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

#define int long long
#define ll long long

#define mem(a, x) memset(a, x, sizeof(a))
#define sum(a) (accumulate((a).begin(), (a).end(), 0ll))
#define mine(a) (*min_element((a).begin(), (a).end()))
#define maxe(a) (*max_element((a).begin(), (a).end()))
#define lowb(a, x) (lower_bound((a).begin(), (a).end(), (x)) - (a).begin())
#define uppb(a, x) (upper_bound((a).begin(), (a).end(), (x)) - (a).begin())
#define all(x) x.begin(), x.end()

#define nl cout << "\n";
#define op(x) cout << x << "\n";
#define opp(x, y) cout << x << " " << y << "\n";
const int MOD = 1e9 + 7;
const int N = 1e5 + 10;
/*--------------------------------------------------------------------------------------------------------------------------*/
void solve()
{
    int l, r;
    cin >> l >> r;
    int i = 30;
    while ((r & (1 << i)) == 0)
    {
        i--;
    }

    int a = 0;
    while (i >= 0)
    {
        if(!(r & (1<<i)) && !(l & (1<<i))){
            a += (1 << i);
        }
        i--;
    }

    i = 0;
    while((a + (1<<i)) <= l){
        i++;
    }
    a += (1 << i);
    
    cout << l << " " << a << " " << r << endl;
}

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

    int t;
    cin >> t;
    while (t--)
        solve();
}
Problem: 2057C - Trip to the Olympiad
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
 
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 << "\n";
}
 
signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
 
    int t = 1;
    cin >> t;
 
    while (t--) {
        solve();
    }
}