ShaysXIA/CodeInsightBench huggingface dataset:
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>
#define ll long long int
#define pb push_back
using namespace std;
#define mod 1000000007

ll lcm(ll a,ll b){
   return (a*b)/(__gcd(a,b));
}

ll LCM(const vector<ll> &d){
   ll result=d[0];
   for(int i=1;i<d.size();++i){
     result=lcm(result , d[i]);
   }
   return result;
}

void solve(){
   ll l,r;cin>>l>>r;
   if(r-l==2){
      cout<<l<<" "<<l+1<<" "<<r<<endl;
      return;
   }
   bitset<64> L(l),R(r),a,b,c;
   int count=0;
   int j=0;
   for(int i=63;i>=0;--i){
      if(L[i]){
         b[i]=L[i];
         c[i]=L[i];
      }
   }
   for(int i=63;i>=0;--i){
      if(R[i]){
         if(b[i]!=1 && c[i]!=1){
           a[i]=1;
           j=i;
           break;
         }
         else a[i]=1;
      }
   }
   for(int i=j-1;i>=0;--i){
      if(b[i]!=1 && c[i]!=1){
         c[i]=1;
      }
   }
   ll x=a.to_ullong();
   ll y=b.to_ullong();
   ll z=c.to_ullong();
   cout<<x<<" "<<y<<" "<<z<<endl;
}

int main(){
   std::ios::sync_with_stdio(false);
   std::cin.tie(nullptr);
   /*freopen("input.txt", "r", stdin);
   freopen("output.txt", "w", stdout);*/
   int t;cin>>t;
   for(int i=1;i<=t;++i){
      //cout<<"Case #"<<i<<": ";
      solve();
   }
}

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

ll lcm(ll a,ll b){
   return (a*b)/(__gcd(a,b));
}

ll LCM(const vector<ll> &d){
   ll result=d[0];
   for(int i=1;i<d.size();++i){
     result=lcm(result , d[i]);
   }
   return result;
}

void solve(){
   ll l,r;cin>>l>>r;
   if(r-l==2){
      cout<<l<<" "<<l+1<<" "<<r<<endl;
      return;
   }
   bitset<64> L(l),R(r),a,b,c;
   int j=0;
   for(int i=63;i>=0;--i){
      if(L[i]){
         b[i]=L[i];
         c[i]=L[i];
      }
   }
   for(int i=63;i>=0;--i){
      if(R[i]){
         if(b[i]!=1 && c[i]!=1){
           a[i]=1;
           j=i;
           break;
         }
         else a[i]=1;
      }
   }
   for(int i=j-1;i>=0;--i){
      if(b[i]!=1 && c[i]!=1){
         c[i]=1;
      }
   }
   ll x=a.to_ullong();
   ll y=b.to_ullong();
   ll z=c.to_ullong();
   if(z==y) z=r; 
   cout<<x<<" "<<y<<" "<<z<<endl;
}

int main(){
   std::ios::sync_with_stdio(false);
   std::cin.tie(nullptr);
   /*freopen("input.txt", "r", stdin);
   freopen("output.txt", "w", stdout);*/
   int t;cin>>t;
   for(int i=1;i<=t;++i){
      //cout<<"Case #"<<i<<": ";
      solve();
   }
}
Problem: 2061D - Kevin and Numbers
Language: Java 8


Submission (verdict: Time limit exceeded on test 1):
import java.io.*;

import java.util.*;



public class Main {

    public static void main(String[] args) throws IOException {

        FastReader in = new FastReader();

        PrintWriter out = new PrintWriter(System.out);



        int t = in.nextInt();

        while (t-- > 0) {

            int n = in.nextInt(), m = in.nextInt();

            // Read a[] into freq map

            HashMap<Integer, Integer> need = new HashMap<>();

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

                int x = in.nextInt();

                need.put(x, need.getOrDefault(x, 0) + 1);

            }

            // Max‑heap for b[]

            PriorityQueue<Integer> pq = new PriorityQueue<>(Collections.reverseOrder());

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

                pq.add(in.nextInt());

            }



            boolean ok = true;

            // Process until heap is empty

            while (!pq.isEmpty()) {

                int x = pq.poll();

                Integer cnt = need.get(x);

                if (cnt != null && cnt > 0) {

                    // match and consume

                    if (cnt == 1) need.remove(x);

                    else need.put(x, cnt - 1);

                } else if (x == 1) {

                    // can't split 1 any further, and it's not needed

                    ok = false;

                    break;

                } else {

                    // split x into two parts that differ by <=1

                    int lo = x / 2;

                    int hi = x - lo;

                    pq.add(lo);

                    pq.add(hi);

                }

            }



            // must have matched every a[i]

            out.println(ok && need.isEmpty() ? "Yes" : "No");

        }

        out.flush();

    }



    static class FastReader {

        BufferedReader br;

        StringTokenizer st;

        FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); }

        String next() throws IOException {

            while (st == null || !st.hasMoreTokens()) {

                String line = br.readLine();

                if (line == null) return null;

                st = new StringTokenizer(line);

            }

            return st.nextToken();

        }

        int nextInt() throws IOException { return Integer.parseInt(next()); }

    }

}
Problem: 2060D - Subtract Min Sort
Language: C++20 (GCC 13-64)


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

using namespace std;

#define improve ios::sync_with_stdio(false),cin.tie(nullptr),cout.tie(nullptr);
#define ll long long
#define S second
#define F first
#define vll vector<ll>
#define el '\n'
#define yes cout << "YES"<< "\n"
#define no cout << "NO"<< "\n"
#define all(v) v.begin(),v.end()
#define allR(v) (v).rbegin(), (v).rend()
#define sz(x) (long long)x.size()
#define ISON(n, k) ((n>>k)&1)
#define Power(n) !(n&(n-1))
#define arrayin(i, n) for(int i = 0; i < n; i++)

void IOF() {
    //    freopen("bye.in", "r", stdin);
#ifndef ONLINE_JUDGE
    freopen("../input.txt", "r", stdin);
    freopen("../output.txt", "w", stdout);
#endif
}

char di[] = {'D', 'L', 'U', 'R'};
int dx[] = {1, -1, 0, 0, -1, -1, 1, 1};
int dy[] = {0, 0, 1, -1, -1, 1, -1, 1};
//const int N = 1e6;
pair<int, int> d1[] = {
    {1, 0}, // Down
    {-1, 0}, // Up
    {0, 1}, // Right
    {0, -1}, // Left
    {-1, -1}, // Top-left diagonal
    {-1, 1}, // Top-right diagonal
    {1, -1}, // Bottom-left diagonal
    {1, 1}
}; // Bottom-right diagonal

const ll N = 2e5 + 5;
const ll M = 1e6 + 5;

int power(int b, int p) {
    if (p == 0)
        return 1;
    int r = power(b, p / 2);
    r *= r;
    if (p & 1) {
        r *= b;
    }
    return r;
}


void solve() {
    ll n;
    cin >> n;
    vector<ll> v(n);
    for (ll i = 0; i < n; i++) {
        cin >> v[i];
    }
    if (is_sorted(all(v))) {
        yes;
        return;
    }
    for (ll i = 0; i < n - 1; i++) {
        if (v[i] - v[i + 1] >= 1) {
            no;
            return;
        } else {
            i++;
        }
    }
    yes;
}


int main() {
    improve
    IOF();
    ll tt = 1;
    cin >> tt;
    while (tt--) {
        solve();
    }

    return 0;
}
Problem: 2050E - Three Strings
Language: C++23 (GCC 14-64, msys2)


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

int32_t main() {
	std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);

	ull t;cin >> t;
    
    while (t--) {
        
        string a, b, c; cin >>a >> b >> c;
        int l1 = a.length(),l2=b.length(),l3=c.length();
        vector<int> prev(l3,0),curr(l3);
        for (int i = 0;i < l1;i++) {
            for (int j = 0;j < l3;j++) {
                if (j != 0){
                    if (a[i] == c[j]) curr[j] = 1 + prev[j - 1];
                    else curr[j] = max(curr[j - 1], prev[j]);
                }
                else {
                    if (a[i] == c[j]) curr[j] = 1 ;
                    else curr[j] = prev[j];
                }
                
            }
            prev = curr;
        }
        int a1 = curr[l3 - 1];string n;
        int count = 0;vector<int>r;
        for (int j = 0;j < l3;j++) {
            if (curr[j] <=count) {
                
                n += string(1,c[j]);
            }
            else count = curr[j];
        }
        l3 = n.size();
        vector<int> prev1(l3, 0), curr1(l3);
        for (int i = 0;i < l2;i++) {
            for (int j = 0;j < l3;j++) {
                if (j != 0) {
                    if (b[i] == n[j]) curr1[j] = 1 + prev1[j - 1];
                    else curr1[j] = max(curr1[j - 1], prev1[j]);
                }
                else {
                    if (b[i] == n[j]) curr1[j] = 1;
                    else curr1[j] = prev1[j];
                }

            }
            prev1 = curr1;
        }
        int a2 = curr[l3 - 1];
        cout << c.size() - a1 - a2<<endl;
    }
    return 0;
}
Problem: 2052A - Adrenaline Rush
Language: C++23 (GCC 14-64, msys2)


Submission (verdict: Wrong answer on test 4):
#include <bits/stdc++.h>
using namespace std;
//unsigned long long mod = 998244353;
const int mod = (1e9) + 7;
#define MAXN 100000
#define int long long
#define sort(v) sort(v.begin(), v.end())
#define print_with_spaces(v, n) for (unsigned int i = 0; i < n; i++){cout << v[i] << " ";}
#define print_with_lines(v, n) for (unsigned int i = 0; i < n; i++){cout << v[i] << "\n";}
#define itr(i,a,b) for (unsigned int i = a; i < b; i++)
#define yes cout << "YES\n"
#define no cout << "NO\n"
#define is_possible cout << ((possible) ? "YES\n": "NO\n")
#define ull unsigned long long
#define ll long long
#define pb push_back
#define pi pair<unsigned long long, unsigned long long>
#define pii pair<int,int>
#define vi vector<int>
#define mp make_pair
#define read(v, n) for (unsigned int i = 0; i < n; i++){cin>>v[i];}

int32_t main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(nullptr);

	int n;cin >> n;
	vi a(n + 1);
	for (int i = 1;i <= n;i++)cin >> a[i];
	int c = 0;
	for (int i = 1;i <= n;i++)
		for (int j = i + 1;j <= n;j++){
			if (a[i] > a[j])c++;
}
	cout << n * (n - 1) - 1 * c << endl;
	for (int i = 1;i <= n;i++) {
		set<int, greater<int>> st;
		for (int j = i + 1;j <= n;j++) if (a[i] > a[j])st.insert(a[j]);
		for (auto& p : st) {
			cout << a[i] << " " << p << '\n';
		}
	}
	for (int i = 1;i <= n;i++)
		for (int j = i + 1;j <= n;j++) if (a[i] < a[j]) {
			cout << a[j] << " " << a[i] << '\n';
			cout << a[i] << " " << a[j] << '\n';
		}
	
	return 0;
}
Problem: 2050C - Uninteresting Number
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 2):
// Problem: C. Uninteresting Number

// Contest: Codeforces - Codeforces Round 991 (Div. 3)

// URL: https://codeforces.com/problemset/problem/2050/C

// Memory Limit: 256 MB

// Time Limit: 2000 ms

// 

// Powered by CP Editor (https://cpeditor.org)



#include <bits/stdc++.h>

#define int long long

#define endl '\n'

using namespace std;

const int N = 2e6 + 10;

int n, m;



void solve() {

	string s;

	cin>>s;

	int sum=0,p=0;

	vector<int>a(4);

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

		sum+=s[i]-'0';

		if(s[i]=='2'){

			a[2]++;

			p+=2;

		}

		if(s[i]=='3'){

			a[3]++;

			p+=6;

		}

	}

	if(sum%9==0){

		cout<<"YES\n";

		return ;

	}

	int need=9-sum%9;

	// if(need==6&&a[3]==1){

		// cout<<"YES\n";

		// return ;

	// }

	// if(a[2]==0){

		// if(need%6==0&&need/6<=a[3]){

			// cout<<"YES\n";

			// return ;

		// }

		// else {

			// cout<<"NO\n";

			// return ;

		// }

	// }

	// for(int i=0;i<=a[2];i++){

		// if(x%6==0&&x/6<=a[3]){

			// cout<<"YES\n";

		// }

	// }

	if(need%2==0&&need/2<a[2]){

		cout<<"YES\n";

		return ;

	}

	if(need%6==0&&need/6<a[3]){

		cout<<"YES\n";

		return ;

	}

	if(p%9==need){

		cout<<"YES\n";

		return ;

	}

	cout<<"NO\n";

}



signed main() {

	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);

	int test = 1;

	cin >> test;

	while (test--) {

		solve();

	}

	return 0;

}

Submission (verdict: Accepted):
// Problem: C. Uninteresting Number

// Contest: Codeforces - Codeforces Round 991 (Div. 3)

// URL: https://codeforces.com/problemset/problem/2050/C

// Memory Limit: 256 MB

// Time Limit: 2000 ms

// 

// Powered by CP Editor (https://cpeditor.org)



#include <bits/stdc++.h>

#define int long long

#define endl '\n'

using namespace std;

const int N = 2e6 + 10;

int n, m;



void solve() {

	string s;

	cin>>s;

	int sum=0,p=0;

	vector<int>a(4);

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

		sum+=s[i]-'0';

		if(s[i]=='2'){

			a[2]++;

		}

		if(s[i]=='3'){

			a[3]++;

		}

	}

	if(sum%9==0){

		cout<<"YES\n";

		return ;

	}

	int need=9-sum%9;

	// if(need==6&&a[3]==1){

		// cout<<"YES\n";

		// return ;

	// }

	// if(a[2]==0){

		// if(need%6==0&&need/6<=a[3]){

			// cout<<"YES\n";

			// return ;

		// }

		// else {

			// cout<<"NO\n";

			// return ;

		// }

	// }

	for(int i=0;i<=min(8ll,a[2]);i++){

		for(int j=0;j<=min(8ll,a[3]);j++)

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

			cout<<"YES\n";

			return ;

		}

	}

	cout<<"NO\n";

}



signed main() {

	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);

	int test = 1;

	cin >> test;

	while (test--) {

		solve();

	}

	return 0;

}
Problem: 2050C - Uninteresting Number
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 2):
// Problem: C. Uninteresting Number

// Contest: Codeforces - Codeforces Round 991 (Div. 3)

// URL: https://codeforces.com/problemset/problem/2050/C

// Memory Limit: 256 MB

// Time Limit: 2000 ms

// 

// Powered by CP Editor (https://cpeditor.org)



#include <bits/stdc++.h>

#define int long long

#define endl '\n'

using namespace std;

const int N = 2e6 + 10;

int n, m;



void solve() {

	string s;

	cin>>s;

	int sum=0,p=0;

	vector<int>a(4);

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

		sum+=s[i]-'0';

		if(s[i]=='2')a[2]++;

		if(s[i]=='3')a[3]++;

	}

	if(sum%9==0){

		cout<<"YES\n";

		return ;

	}

	int need=9-sum%9;

	if(need==6&&a[3]==1){

		cout<<"YES\n";

		return ;

	}

	if(a[2]==0){

		if(need%3==0&&need/3<=a[3]){

			cout<<"YES\n";

			return ;

		}

		else {

			cout<<"NO\n";

			return ;

		}

	}

	for(int i=1;i<=a[2];i++){

		int x=need-2*i;

		if(x%3==0&&x/3<=a[3]){

			cout<<"YES\n";

			return ;

		}

	}

	cout<<"NO\n";

}



signed main() {

	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);

	int test = 1;

	cin >> test;

	while (test--) {

		solve();

	}

	return 0;

}

Submission (verdict: Wrong answer on test 2):
// Problem: C. Uninteresting Number

// Contest: Codeforces - Codeforces Round 991 (Div. 3)

// URL: https://codeforces.com/problemset/problem/2050/C

// Memory Limit: 256 MB

// Time Limit: 2000 ms

// 

// Powered by CP Editor (https://cpeditor.org)



#include <bits/stdc++.h>

#define int long long

#define endl '\n'

using namespace std;

const int N = 2e6 + 10;

int n, m;



void solve() {

	string s;

	cin>>s;

	int sum=0,p=0;

	vector<int>a(4);

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

		sum+=s[i]-'0';

		if(s[i]=='2'){

			a[2]++;

			p+=2;

		}

		if(s[i]=='3'){

			a[3]++;

			p+=6;

		}

	}

	if(sum%9==0){

		cout<<"YES\n";

		return ;

	}

	int need=9-sum%9;

	// if(need==6&&a[3]==1){

		// cout<<"YES\n";

		// return ;

	// }

	// if(a[2]==0){

		// if(need%6==0&&need/6<=a[3]){

			// cout<<"YES\n";

			// return ;

		// }

		// else {

			// cout<<"NO\n";

			// return ;

		// }

	// }

	// for(int i=0;i<=a[2];i++){

		// if(x%6==0&&x/6<=a[3]){

			// cout<<"YES\n";

		// }

	// }

	if(need%2==0&&need/2<a[2]){

		cout<<"YES\n";

		return ;

	}

	if(need%6==0&&need/6<a[3]){

		cout<<"YES\n";

		return ;

	}

	if(p%9==need){

		cout<<"YES\n";

		return ;

	}

	cout<<"NO\n";

}



signed main() {

	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);

	int test = 1;

	cin >> test;

	while (test--) {

		solve();

	}

	return 0;

}
Problem: 2050C - Uninteresting Number
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 2):
// Problem: C. Uninteresting Number

// Contest: Codeforces - Codeforces Round 991 (Div. 3)

// URL: https://codeforces.com/problemset/problem/2050/C

// Memory Limit: 256 MB

// Time Limit: 2000 ms

// 

// Powered by CP Editor (https://cpeditor.org)



#include <bits/stdc++.h>

#define int long long

#define endl '\n'

using namespace std;

const int N = 2e6 + 10;

int n, m;



void solve() {

	string s;

	cin>>s;

	int sum=0,p=0;

	vector<int>a(4);

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

		sum+=s[i]-'0';

		if(s[i]=='2')a[2]++;

		if(s[i]=='3')a[3]++;

	}

	if(sum%9==0){

		cout<<"YES\n";

		return ;

	}

	int need=9-sum%9;

	if(a[2]==0){

		if(need%3==0&&need/3<=a[3]){

			cout<<"YES\n";

			return ;

		}

		else {

			cout<<"NO\n";

			return ;

		}

	}

	for(int i=1;i<=a[2];i++){

		int x=need-2*i;

		if(x%3==0&&x/3<=a[3]){

			cout<<"YES\n";

			return ;

		}

	}

	cout<<"NO\n";

}



signed main() {

	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);

	int test = 1;

	cin >> test;

	while (test--) {

		solve();

	}

	return 0;

}

Submission (verdict: Wrong answer on test 2):
// Problem: C. Uninteresting Number

// Contest: Codeforces - Codeforces Round 991 (Div. 3)

// URL: https://codeforces.com/problemset/problem/2050/C

// Memory Limit: 256 MB

// Time Limit: 2000 ms

// 

// Powered by CP Editor (https://cpeditor.org)



#include <bits/stdc++.h>

#define int long long

#define endl '\n'

using namespace std;

const int N = 2e6 + 10;

int n, m;



void solve() {

	string s;

	cin>>s;

	int sum=0,p=0;

	vector<int>a(4);

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

		sum+=s[i]-'0';

		if(s[i]=='2')a[2]++;

		if(s[i]=='3')a[3]++;

	}

	if(sum%9==0){

		cout<<"YES\n";

		return ;

	}

	int need=9-sum%9;

	if(s=="3"){

		cout<<"YES\n";

		return ;

	}

	if(a[2]==0){

		if(need%3==0&&need/3<=a[3]){

			cout<<"YES\n";

			return ;

		}

		else {

			cout<<"NO\n";

			return ;

		}

	}

	for(int i=1;i<=a[2];i++){

		int x=need-2*i;

		if(x%3==0&&x/3<=a[3]){

			cout<<"YES\n";

			return ;

		}

	}

	cout<<"NO\n";

}



signed main() {

	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);

	int test = 1;

	cin >> test;

	while (test--) {

		solve();

	}

	return 0;

}
Problem: 2050C - Uninteresting Number
Language: C++20 (GCC 13-64)


Submission (verdict: Wrong answer on test 2):
// Problem: C. Uninteresting Number

// Contest: Codeforces - Codeforces Round 991 (Div. 3)

// URL: https://codeforces.com/problemset/problem/2050/C

// Memory Limit: 256 MB

// Time Limit: 2000 ms

// 

// Powered by CP Editor (https://cpeditor.org)



#include <bits/stdc++.h>

#define int long long

#define endl '\n'

using namespace std;

const int N = 2e6 + 10;

int n, m;



void solve() {

	string s;

	cin>>s;

	int sum=0,p=0;

	vector<int>a(4);

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

		sum+=s[i]-'0';

		if(s[i]=='2')a[2]++;

		if(s[i]=='3')a[3]++;

	}

	if(sum%9==0){

		cout<<"YES\n";

		return ;

	}

	int need=9-sum%9;

	if(a[2]==0){

		if(need%3==0&&need/3<=a[3]){

			cout<<"YES\n";

			return ;

		}

		else {

			cout<<"NO\n";

			return ;

		}

	}

	for(int i=1;i<=a[2];i++){

		int x=need-2*i;

		if(x%3==0&&x/3<=a[3]){

			cout<<"YES\n";

			return ;

		}

	}

	cout<<"NO\n";

}



signed main() {

	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);

	int test = 1;

	cin >> test;

	while (test--) {

		solve();

	}

	return 0;

}
Problem: 2050C - Uninteresting Number
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 2):
// Problem: C. Uninteresting Number

// Contest: Codeforces - Codeforces Round 991 (Div. 3)

// URL: https://codeforces.com/problemset/problem/2050/C

// Memory Limit: 256 MB

// Time Limit: 2000 ms

// 

// Powered by CP Editor (https://cpeditor.org)



#include <bits/stdc++.h>

#define int long long

#define endl '\n'

using namespace std;

const int N = 2e6 + 10;

int n, m;



void solve() {

	string s;

	cin>>s;

	int sum=0,p=0;

	vector<int>a(4);

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

		sum+=s[i]-'0';

		if(s[i]=='2')a[2]++;

		if(s[i]=='3')a[3]++;

	}

	if(sum%9==0){

		cout<<"YES\n";

		return ;

	}

	int need=9-sum%9;

	if(s=="3"){

		cout<<"YES\n";

		return ;

	}

	if(a[2]==0){

		if(need%3==0&&need/3<=a[3]){

			cout<<"YES\n";

			return ;

		}

		else {

			cout<<"NO\n";

			return ;

		}

	}

	for(int i=1;i<=a[2];i++){

		int x=need-2*i;

		if(x%3==0&&x/3<=a[3]){

			cout<<"YES\n";

			return ;

		}

	}

	cout<<"NO\n";

}



signed main() {

	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);

	int test = 1;

	cin >> test;

	while (test--) {

		solve();

	}

	return 0;

}

Submission (verdict: Wrong answer on test 2):
// Problem: C. Uninteresting Number

// Contest: Codeforces - Codeforces Round 991 (Div. 3)

// URL: https://codeforces.com/problemset/problem/2050/C

// Memory Limit: 256 MB

// Time Limit: 2000 ms

// 

// Powered by CP Editor (https://cpeditor.org)



#include <bits/stdc++.h>

#define int long long

#define endl '\n'

using namespace std;

const int N = 2e6 + 10;

int n, m;



void solve() {

	string s;

	cin>>s;

	int sum=0,p=0;

	vector<int>a(4);

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

		sum+=s[i]-'0';

		if(s[i]=='2')a[2]++;

		if(s[i]=='3')a[3]++;

	}

	if(sum%9==0){

		cout<<"YES\n";

		return ;

	}

	int need=9-sum%9;

	if(need==6&&a[3]==1){

		cout<<"YES\n";

		return ;

	}

	if(a[2]==0){

		if(need%3==0&&need/3<=a[3]){

			cout<<"YES\n";

			return ;

		}

		else {

			cout<<"NO\n";

			return ;

		}

	}

	for(int i=1;i<=a[2];i++){

		int x=need-2*i;

		if(x%3==0&&x/3<=a[3]){

			cout<<"YES\n";

			return ;

		}

	}

	cout<<"NO\n";

}



signed main() {

	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);

	int test = 1;

	cin >> test;

	while (test--) {

		solve();

	}

	return 0;

}
Problem: 2057C - Trip to the Olympiad
Language: C++20 (GCC 13-64)


Submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
// clang-format off
#ifdef _MSC_VER
#if __has_include(<__msvc_int128.hpp>)
#include <__msvc_int128.hpp>
using i128=std::_Signed128;using u128=std::_Unsigned128;
#endif
#else
using i128=__int128_t;using u128=__uint128_t;
#endif
#define rep(i, s, e) for (auto i = (s); i <= (e); ++i)
#define per(i, e, s) for (auto i = (s); i >= (e); --i)
#define dop(i, s, e) for (auto i = (s); i >= (e); --i)
using namespace std;
using ll=int64_t;using ull=uint64_t;using PI=pair<int,int>;using PL=pair<ll,ll>;using PIL=pair<int,ll>;using PLI=
pair<ll,int>;using VI=vector<int>;using VL=vector<ll>;using VVI=vector<VI>;using VVL=vector<VL>;template<class T,
class U>void chkmin(T&a,U b){if(a>b)a=b;}template<class T,class U>void chkmax(T&a,U b){if(a<b)a=b;}
#if 1
char nc(){constexpr int NCBUF=1<<21;static char b[NCBUF],*x=b,*y=b;return x==y&&(y=(x=b)+fread(b,1,NCBUF,stdin),x==y
)?EOF:*x++;}template<class T>bool input(T&x){x=0;char c=nc();bool f=0;while(c<'0'||c>'9'){if(c==EOF)return 0;f=c=='-'
,c=nc();}while(c>='0'&&c<='9')x=x*10+(c^48),c=nc();if(f)x=-x;return 1;}bool input(char&x){for(;;){x=nc();if(x==EOF)
return 0;if(!isspace(x))return 1;}}template<int p=0>bool input(string&s){s.resize(p+1);if(!input(s.back()))return 0;
do s.push_back(nc());while(!(s.back()==EOF||isspace(s.back())));s.pop_back();return 1;}bool input(char*p){if(!input(
*p))return 0;do*++p=nc();while(!(*p==EOF||isspace(*p)));*p=0;return 1;}template<class T,class...S>bool input(T&x,S&
...y){return input(x)&&input(y...);}
#else
template<class...T>bool input(T&...x){return(bool)(cin>>...>>x);}
#endif
template<class T>T input(){T x;input(x);return x;}template<class...T>enable_if_t<1<sizeof...(T),tuple<T...>>input()
{return{input<T>()...};}template<class T,int N>auto input(){array<T,N>a;for(T&x:a)input(x);return a;}template<class
...T>void print(T...y){bool f=0;(((f?((cout<<' '),0):f=1),cout<<y),...);}template<class...T>void println(T...y){
print(y...);cout<<'\n';}
// clang-format on

// constexpr ll MOD = 998244353;
constexpr ll MOD = int(1e9) + 7;
constexpr auto INF = numeric_limits<ll>::max();

void solve() {
    const auto [L, R] = input<ll, 2>();
    auto find_i = [&]() {
        dop(i, 31, 0) if (((L >> i) & 1) != ((R >> i) & 1)) return i;
        return 0;
    };
    const int I = find_i();
    const ll mask = (1ll << I) - 1;
    ll a = (R & ~mask) | (1ll << I);
    ll b = ((R & ~mask) & ~(1ll << I)) | mask;
    ll c = a != R ? a + 1 : b - 1;
    println(a, b, c);
}

int main() {
    ios::sync_with_stdio(false), cin.tie(0);
    for (auto T = input<int>(); T--;) {
        // solve();
        (solve());
        // println(solve() ? "YES" : "NO");
    }
}