ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2050C - Uninteresting Number
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 3):
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    long long t;
    cin>>t;
    while(t--){
        long long n,s=0,tw=0,th=0;
        cin>>n;
        string m=to_string(n);
        for(int i=0;i<m.size();i++){
            if(m[i]-'0'==2&&tw<10)
                tw++;
            if(m[i]-'0'==3&&th<10)
                th++;
            s+=(m[i]-'0');
            s=s%9;
        }
        if(s==0)
            cout<<"YES"<<endl;
        else{
            long long f=0,l=8;
            if(tw==0){
                for(int j=0;j<=min(l,th);j++){
                    if((s+j*6)%9==0){
                        f=1;
                        break;
                    }
                }
            }
            else if(th==0){
                for(int j=0;j<=min(l,tw);j++){
                    if((s+j*2)%9==0){
                        f=1;
                        break;
                    }
                }
            }
            else{
                for(int i=0;i<=min(l,tw);i++){
                    for(int j=0;j<=min(l,th);j++){
                        if((s+i*2+j*6)%9==0){
                            f=1;
                            break;
                        }
                    }
                    if(f==1)
                        break;
                }
            }
            if(f==1)
                cout<<"YES"<<endl;
            else
                cout<<"NO"<<endl;   
        }
    }
    return 0;
}

Submission (verdict: Wrong answer on test 3):
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    long long t;
    cin>>t;
    while(t--){
        long long n,s=0,tw=1,th=1;
        cin>>n;
        string m=to_string(n);
        for(int i=0;i<m.size();i++){
            if(m[i]-'0'==2&&tw<10)
                tw++;
            if(m[i]-'0'==3&&th<10)
                th++;
            s+=(m[i]-'0');
            s=s%9;
        }
        long long f=0,l=10;
        // if(tw==0){
        //     for(int j=0;j<=min(l,th);j++){
        //         if((s+j*6)%9==0){
        //             f=1;
        //             break;
        //         }
        //     }
        // }
        // else if(th==0){
        //     for(int j=0;j<=min(l,tw);j++){
        //         if((s+j*2)%9==0){
        //             f=1;
        //             break;
        //         }
        //     }
        // }
        // else{
            for(int i=0;i<min(l,tw);i++){
                for(int j=0;j<min(l,th);j++){
                    if((s+i*2+j*6)%9==0){
                        f=1;
                        break;
                    }
                }
                if(f==1)
                    break;
            }
        // }
        if(f==1)
            cout<<"YES"<<endl;
        else
            cout<<"NO"<<endl;   
    }
    return 0;
}
Problem: 2050C - Uninteresting Number
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 3):
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    long long t;
    cin>>t;
    while(t--){
        long long n,s=0,tw=0,th=0;
        cin>>n;
        string m=to_string(n);
        for(int i=0;i<m.size();i++){
            if(m[i]-'0'==2)
                tw++;
            if(m[i]-'0'==3)
                th++;
            s+=(m[i]-'0');
            s=s%9;
        }
        if(s==0)
            cout<<"YES"<<endl;
        else{
            long long f=0,l=8;
            for(int i=0;i<=min(l,tw);i++){
                for(int j=0;j<=min(l,th);j++){
                    if((s+i*2+j*6)%9==0){
                        f=1;
                        break;
                    }
                }
            }
            if(tw==0){
                for(int j=0;j<=min(l,th);j++){
                    if((s+j*6)%9==0){
                        f=1;
                        break;
                    }
                }
            }
            if(th==0){
                for(int j=0;j<=min(l,tw);j++){
                    if((s+j*2)%9==0){
                        f=1;
                        break;
                    }
                }
            }
            if(f==1)
                cout<<"YES"<<endl;
            else
                cout<<"NO"<<endl;   
        }
    }
    return 0;
}
Problem: 2050C - Uninteresting Number
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 3):
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    long long t;
    cin>>t;
    while(t--){
        long long n,s=0,tw=1,th=1;
        cin>>n;
        string m=to_string(n);
        for(int i=0;i<m.size();i++){
            if(m[i]-'0'==2&&tw<10)
                tw++;
            if(m[i]-'0'==3&&th<10)
                th++;
            s+=(m[i]-'0');
            s=s%9;
        }
        long long f=0,l=10;
        // if(tw==0){
        //     for(int j=0;j<=min(l,th);j++){
        //         if((s+j*6)%9==0){
        //             f=1;
        //             break;
        //         }
        //     }
        // }
        // else if(th==0){
        //     for(int j=0;j<=min(l,tw);j++){
        //         if((s+j*2)%9==0){
        //             f=1;
        //             break;
        //         }
        //     }
        // }
        // else{
            for(int i=0;i<min(l,tw);i++){
                for(int j=0;j<min(l,th);j++){
                    if((s+i*2+j*6)%9==0){
                        f=1;
                        break;
                    }
                }
                if(f==1)
                    break;
            }
        // }
        if(f==1)
            cout<<"YES"<<endl;
        else
            cout<<"NO"<<endl;   
    }
    return 0;
}

Submission (verdict: Accepted):
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    long long t;
    cin>>t;
    while(t--){
        long long s=0,tw=1,th=1;
        string m;
        cin>>m;
        for(int i=0;i<m.size();i++){
            if(m[i]=='2')
                tw++;
            if(m[i]=='3')
                th++;
            s+=(m[i]-'0');
            // s=s%9;
        }
        long long f=0,l=10;
        for(int i=0;i<tw;i++){
            for(int j=0;j<th;j++){
                if((s+i*2+j*6)%9==0){
                    f=1;
                    break;
                }
            }
            if(f==1)
                break;
        }
        if(f==1)
            cout<<"YES"<<endl;
        else
            cout<<"NO"<<endl;   
    }
    return 0;
}
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;
#define int long long int

int power(int x, int y){
    int res = 1;
    while(y>>0){
        if(y&1)
        res*=x;
        y = y>>1;
        x = x*x;
    }
    return res;
}

void solve(){
    int n, sz, sum = 0;
    cin>>n;
    sz = n;
    vector<int> v(n);
    for(auto &x: v) {
        cin>>x;
        sum+=x;
    }
    if(n==1) {
        cout<<v[0]<<endl;
        return;
    }
    
    
    while(sz!=1){
        sz--;
        for(int i=0;i<sz;i++){
            v[i] = v[i+1]-v[i];
        }
    }
    cout<<max(sum, abs(v[0]))<<endl;
}

signed main(){
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
#endif
    int tcs;
    cin>>tcs;
    while(tcs--)
        solve();
    return 0;
}

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

int power(int x, int y){
    int res = 1;
    while(y>>0){
        if(y&1)
        res*=x;
        y = y>>1;
        x = x*x;
    }
    return res;
}

void solve(){
    int n, sz, sum = 0, sum2 = 0;
    cin>>n;
    sz = n;
    vector<int> v(n);
    for(auto &x: v) {
        cin>>x;
        sum+=x;
    }
    if(n==1) {
        cout<<v[0]<<endl;
        return;
    }
    
    
    while(sz!=1){
        sz--;
        for(int i=0;i<sz;i++){
            v[i] = v[i+1]-v[i];
        }
        for(int i=0;i<sz;i++){
            sum2+=v[i];
        }
        sum = max(sum,sum2);
    }
    cout<<max(sum, abs(v[0]))<<endl;
}

signed main(){
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
#endif
    int tcs;
    cin>>tcs;
    while(tcs--)
        solve();
    return 0;
}
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;
#define int long long int

int power(int x, int y){
    int res = 1;
    while(y>>0){
        if(y&1)
        res*=x;
        y = y>>1;
        x = x*x;
    }
    return res;
}

void solve(){
    int n, sz, sum = 0, sum2 = 0;
    cin>>n;
    sz = n;
    vector<int> v(n);
    for(auto &x: v) {
        cin>>x;
        sum+=x;
    }
    if(n==1) {
        cout<<v[0]<<endl;
        return;
    }
    
    
    while(sz!=1){
        sz--;
        for(int i=0;i<sz;i++){
            v[i] = v[i+1]-v[i];
        }
        sum2 = 0;
        for(int i=0;i<sz;i++){
            sum2+=v[i];
        }
        sum = max(sum,sum2);
    }
    cout<<max(sum, abs(v[0]))<<endl;
}

signed main(){
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
#endif
    int tcs;
    cin>>tcs;
    while(tcs--)
        solve();
    return 0;
}

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

int power(int x, int y){
    int res = 1;
    while(y>>0){
        if(y&1)
        res*=x;
        y = y>>1;
        x = x*x;
    }
    return res;
}

void solve(){
    int n, sz, sum = 0, sum2 = 0;
    cin>>n;
    sz = n;
    vector<int> v(n);
    for(auto &x: v) {
        cin>>x;
        sum+=x;
    }
    if(n==1) {
        cout<<v[0]<<endl;
        return;
    }
    
    
    while(sz!=1){
        sz--;
        for(int i=0;i<sz;i++){
            v[i] = v[i+1]-v[i];
        }
        sum2 = 0;
        for(int i=0;i<sz;i++){
            sum2+=v[i];
        }
        sum = max(sum,abs(sum2));
    }
    cout<<max(sum, abs(v[0]))<<endl;
}

signed main(){
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
#endif
    int tcs;
    cin>>tcs;
    while(tcs--)
        solve();
    return 0;
}
Problem: 2062C - Cirno and Operations
Language: C++17 (GCC 7-32)


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

int power(int x, int y){
    int res = 1;
    while(y>>0){
        if(y&1)
        res*=x;
        y = y>>1;
        x = x*x;
    }
    return res;
}

void solve(){
    int n, sz, sum = 0;
    cin>>n;
    sz = n;
    vector<int> v(n);
    for(auto &x: v) {
        cin>>x;
        sum+=x;
    }
    while(sz!=1){
        sz--;
        for(int i=0;i<sz;i++){
            v[i] = v[i+1]-v[i];
        }
    }
    cout<<max(sum, abs(v[0]))<<endl;
}

signed main(){
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
#endif
    int tcs;
    cin>>tcs;
    while(tcs--)
        solve();
    return 0;
}
Problem: 2062C - Cirno and Operations
Language: C++17 (GCC 7-32)

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

int power(int x, int y){
    int res = 1;
    while(y>>0){
        if(y&1)
        res*=x;
        y = y>>1;
        x = x*x;
    }
    return res;
}

void solve(){
    int n, sz, sum = 0, sum2 = 0;
    cin>>n;
    sz = n;
    vector<int> v(n);
    for(auto &x: v) {
        cin>>x;
        sum+=x;
    }
    if(n==1) {
        cout<<v[0]<<endl;
        return;
    }
    
    
    while(sz!=1){
        sz--;
        for(int i=0;i<sz;i++){
            v[i] = v[i+1]-v[i];
        }
        for(int i=0;i<sz;i++){
            sum2+=v[i];
        }
        sum = max(sum,sum2);
    }
    cout<<max(sum, abs(v[0]))<<endl;
}

signed main(){
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
#endif
    int tcs;
    cin>>tcs;
    while(tcs--)
        solve();
    return 0;
}

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

int power(int x, int y){
    int res = 1;
    while(y>>0){
        if(y&1)
        res*=x;
        y = y>>1;
        x = x*x;
    }
    return res;
}

void solve(){
    int n, sz, sum = 0, sum2 = 0;
    cin>>n;
    sz = n;
    vector<int> v(n);
    for(auto &x: v) {
        cin>>x;
        sum+=x;
    }
    if(n==1) {
        cout<<v[0]<<endl;
        return;
    }
    
    
    while(sz!=1){
        sz--;
        for(int i=0;i<sz;i++){
            v[i] = v[i+1]-v[i];
        }
        sum2 = 0;
        for(int i=0;i<sz;i++){
            sum2+=v[i];
        }
        sum = max(sum,sum2);
    }
    cout<<max(sum, abs(v[0]))<<endl;
}

signed main(){
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
#endif
    int tcs;
    cin>>tcs;
    while(tcs--)
        solve();
    return 0;
}
Problem: 2062C - Cirno and Operations
Language: C++17 (GCC 7-32)

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

int power(int x, int y){
    int res = 1;
    while(y>>0){
        if(y&1)
        res*=x;
        y = y>>1;
        x = x*x;
    }
    return res;
}

void solve(){
    int n, sz, sum = 0;
    cin>>n;
    sz = n;
    vector<int> v(n);
    for(auto &x: v) {
        cin>>x;
        sum+=x;
    }
    while(sz!=1){
        sz--;
        for(int i=0;i<sz;i++){
            v[i] = v[i+1]-v[i];
        }
    }
    cout<<max(sum, abs(v[0]))<<endl;
}

signed main(){
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
#endif
    int tcs;
    cin>>tcs;
    while(tcs--)
        solve();
    return 0;
}

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

int power(int x, int y){
    int res = 1;
    while(y>>0){
        if(y&1)
        res*=x;
        y = y>>1;
        x = x*x;
    }
    return res;
}

void solve(){
    int n, sz, sum = 0;
    cin>>n;
    sz = n;
    vector<int> v(n);
    for(auto &x: v) {
        cin>>x;
        sum+=x;
    }
    if(n==1) {
        cout<<v[0]<<endl;
        return;
    }
    
    
    while(sz!=1){
        sz--;
        for(int i=0;i<sz;i++){
            v[i] = v[i+1]-v[i];
        }
    }
    cout<<max(sum, abs(v[0]))<<endl;
}

signed main(){
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
#endif
    int tcs;
    cin>>tcs;
    while(tcs--)
        solve();
    return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 1):
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<cmath>
#include<queue>
#include<map>
#include<set>
#define ll long long
#define fi first
#define se second
using namespace std;
typedef pair<ll, ll>PII;
const int N = 2e5 + 5;
const int inf = 0x3f3f3f3f;
int TT = 1;

ll l, r;
void sol() {
	cin >> l >> r;
	ll co = 0, tmp = r;
	while (tmp)co++, tmp >>= 1;
	--co;
	cout << (1 << co) << ' ' << ((1 << co) - 1) << ' ' << l << endl;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0), cout.tie(0);

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

Previous submission (verdict: Wrong answer on test 1):
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<cmath>
#include<queue>
#include<map>
#include<set>
#define ll long long
#define fi first
#define se second
using namespace std;
typedef pair<ll, ll>PII;
const int N = 2e5 + 5;
const int inf = 0x3f3f3f3f;
int TT = 1;

ll l, r;
void sol() {
	cin >> l >> r;
	ll tmp = 0;
	for (int i = 30; i >= 0; --i) {
		bool t1 = (r >> i & 1), t2 = (l >> i & 1);
		if ((tmp | (1 << i)) < r && t1 == t2)tmp |= (1 << i);
	}
	if (tmp == l)tmp++;
	cout << l << ' ' << tmp << ' ' << r << endl;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0), cout.tie(0);

	cin >> TT;
	while (TT--)sol();
	return 0;
}

Submission (verdict: Wrong answer on test 1):
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<cmath>
#include<queue>
#include<map>
#include<set>
#define ll long long
#define fi first
#define se second
using namespace std;
typedef pair<ll, ll>PII;
const int N = 2e5 + 5;
const int inf = 0x3f3f3f3f;
int TT = 1;

ll l, r;
void sol() {
	cin >> l >> r;
	ll tmp = 0;
	for (int i = 30; i >= 0; --i) {
		ll t1 = (r >> i & 1), t2 = (l >> i & 1);
		if ((tmp | (1 << i)) < r)tmp |= (1 << i);
	}
	if (tmp == l)tmp++;
	cout << l << ' ' << tmp << ' ' << r << endl;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0), cout.tie(0);

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

Previous submission (verdict: Wrong answer on test 1):
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<cmath>
#include<queue>
#include<map>
#include<set>
#define ll long long
#define fi first
#define se second
using namespace std;
typedef pair<ll, ll>PII;
const int N = 2e5 + 5;
const int inf = 0x3f3f3f3f;
int TT = 1;

ll l, r;
void sol() {
	cin >> l >> r;
	ll tmp = 0;
	for (int i = 30; i >= 0; --i) {
		ll t1 = (r >> i & 1), t2 = (l >> i & 1);
		if ((tmp | (1 << i)) < r)tmp |= (1 << i);
	}
	if (tmp == l)tmp++;
	cout << l << ' ' << tmp << ' ' << r << endl;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0), cout.tie(0);

	cin >> TT;
	while (TT--)sol();
	return 0;
}

Submission (verdict: Accepted):
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<cmath>
#include<queue>
#include<map>
#include<set>
#define ll long long
#define fi first
#define se second
using namespace std;
typedef pair<ll, ll>PII;
const int N = 2e5 + 5;
const int inf = 0x3f3f3f3f;
int TT = 1;

ll l, r;
void sol() {
	cin >> l >> r;
	ll co = log2(r), ans = 0;
	while ((l >> co & 1) == (r >> co & 1))ans += (r >> co & 1) << co, --co;
	ans += (1 << co);
	if (ans - 1 == l)cout << l << ' ' << ans << ' ' << ans + 1 << endl;
	else cout << l << ' ' << ans - 1 << ' ' << ans << endl;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0), cout.tie(0);

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

Previous submission (verdict: Wrong answer on test 1):
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<cmath>
#include<queue>
#include<map>
#include<set>
#define ll long long
#define fi first
#define se second
using namespace std;
typedef pair<ll, ll>PII;
const int N = 2e5 + 5;
const int inf = 0x3f3f3f3f;
int TT = 1;

ll l, r;
void sol() {
	cin >> l >> r;
	ll co = 0, tmp = r;
	while (tmp)co++, tmp >>= 1;
	--co;
	ll ans1 = (1 << co), ans2 = ans1 - 1, ans3 = l;
	if (ans3 == ans2)ans3 = ans1 + 1;
	cout << ans1 << ' ' << ans2 << ' ' << ans3 << endl;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0), cout.tie(0);

	cin >> TT;
	while (TT--)sol();
	return 0;
}

Submission (verdict: Wrong answer on test 1):
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<cmath>
#include<queue>
#include<map>
#include<set>
#define ll long long
#define fi first
#define se second
using namespace std;
typedef pair<ll, ll>PII;
const int N = 2e5 + 5;
const int inf = 0x3f3f3f3f;
int TT = 1;

ll l, r;
void sol() {
	cin >> l >> r;
	ll tmp = 0;
	for (int i = 30; i >= 0; --i) {
		bool t1 = (r >> i & 1), t2 = (l >> i & 1);
		if ((tmp | (1 << i)) < r && t1 == t2)tmp |= (1 << i);
	}
	if (tmp == l)tmp++;
	cout << l << ' ' << tmp << ' ' << r << endl;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0), cout.tie(0);

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

Previous submission (verdict: Wrong answer on test 1):
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<cmath>
#include<queue>
#include<map>
#include<set>
#define ll long long
#define fi first
#define se second
using namespace std;
typedef pair<ll, ll>PII;
const int N = 2e5 + 5;
const int inf = 0x3f3f3f3f;
int TT = 1;

ll l, r;
void sol() {
	cin >> l >> r;
	ll co = 0, tmp = r;
	while (tmp)co++, tmp >>= 1;
	--co;
	cout << (1 << co) << ' ' << ((1 << co) - 1) << ' ' << l << endl;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0), cout.tie(0);

	cin >> TT;
	while (TT--)sol();
	return 0;
}

Submission (verdict: Wrong answer on test 1):
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<cmath>
#include<queue>
#include<map>
#include<set>
#define ll long long
#define fi first
#define se second
using namespace std;
typedef pair<ll, ll>PII;
const int N = 2e5 + 5;
const int inf = 0x3f3f3f3f;
int TT = 1;

ll l, r;
void sol() {
	cin >> l >> r;
	ll co = 0, tmp = r;
	while (tmp)co++, tmp >>= 1;
	--co;
	ll ans1 = (1 << co), ans2 = ans1 - 1, ans3 = l;
	if (ans3 == ans2)ans3 = ans1 + 1;
	cout << ans1 << ' ' << ans2 << ' ' << ans3 << endl;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0), cout.tie(0);

	cin >> TT;
	while (TT--)sol();
	return 0;
}
Problem: 2050D - Digital string maximization
Language: C++20 (GCC 13-64)


Submission (verdict: Time limit exceeded on test 6):
#include <bits/stdc++.h>

using namespace std;

using ll = long long;



void solve() {

// ll n;

// cin >> n;

// vector<ll> a(n);

// for (ll i = 0; i < n; i++) {

//     cin >> a[i];

// }



string s; cin >> s;

int length = s.size();



while(length--) {

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

if (s[i] < s[i + 1] - 1) {

s[i + 1] -= 1;

swap(s[i], s[i + 1]);

}

}

}



cout << s << "\n";





}



int main() {

ios::sync_with_stdio(0);

cin.tie(0);

ll t;

cin >> t;

while (t--) {

solve();

}

return 0;

}
Problem: 2050D - Digital string maximization
Language: C++20 (GCC 13-64)

Previous submission (verdict: Time limit exceeded on test 6):
#include <bits/stdc++.h>

using namespace std;

using ll = long long;



void solve() {

// ll n;

// cin >> n;

// vector<ll> a(n);

// for (ll i = 0; i < n; i++) {

//     cin >> a[i];

// }



string s; cin >> s;

int length = s.size();



while(length--) {

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

if (s[i] < s[i + 1] - 1) {

s[i + 1] -= 1;

swap(s[i], s[i + 1]);

}

}

}



cout << s << "\n";





}



int main() {

ios::sync_with_stdio(0);

cin.tie(0);

ll t;

cin >> t;

while (t--) {

solve();

}

return 0;

}



Submission (verdict: Time limit exceeded on test 6):
#include <bits/stdc++.h>

using namespace std;

using ll = long long;



void solve() {

// ll n;

// cin >> n;

// vector<ll> a(n);

// for (ll i = 0; i < n; i++) {

//     cin >> a[i];

// }



string s; cin >> s;

ll length = s.size();



while(length--) {

for (ll i = 0; i < s.size() - 1; i++) {

if (s[i] < s[i + 1] - 1) {

s[i + 1] -= 1;

swap(s[i], s[i + 1]);

}

}

}



cout << s << "\n";





}



int main() {

ios::sync_with_stdio(0);

cin.tie(0);

ll t;

cin >> t;

while (t--) {

solve();

}

return 0;

}