ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2050C - Uninteresting Number
Language: C++23 (GCC 14-64, msys2)

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

bool solve(string n) {
    int sum = 0;
    int left = 0, right = n.length() - 1;

    // Two pointers, moving from both ends
    while (left <= right) {
        // Check the left pointer
        if (n[left] == '2') {
            sum += 4;  // 2^2 = 4
        } else if (n[left] == '3') {
            sum += 9;  // 3^2 = 9
        }
        
        // Check the right pointer (make sure it's not the same as the left)
        if (left != right) {
            if (n[right] == '2') {
                sum += 4;  
            } else if (n[right] == '3') {
                sum += 9;  // 3^2 = 9
            }
        }

        // Move the pointers
        left++;
        right--;
    }

    // Check if the sum of squared digits is divisible by 9
    return (sum % 9 == 0);
}

int main() {
    int t;
    cin >> t;
    while(t--) {
        string n;
        cin >> n;
        int digit_sum = 0;
		for (char c : n) {
		    digit_sum += c - '0'; 
		}
		
		if (digit_sum % 9 == 0) {
		    cout << "YES" << endl;
		} else {
		    cout << "NO" << endl;
		} else {
            if (solve(n)) {
                cout << "YES" << endl;
            } else {
                cout << "NO" << endl;
            }
        }
    }
    return 0;
}

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

bool solve(string n) {
    int sum = 0;
    size_t left = 0, right = n.size() - 1;

    // Two pointers, moving from both ends
    while (left <= right) {
        // Check the left pointer
        if (n[left] == '2') {
            sum += 4;  // 2^2 = 4
        } else if (n[left] == '3') {
            sum += 9;  // 3^2 = 9
        }
        
        // Check the right pointer (make sure it's not the same as the left)
        if (left != right) {
            if (n[right] == '2') {
                sum += 4;  // 2^2 = 4
            } else if (n[right] == '3') {
                sum += 9;  // 3^2 = 9
            }
        }

        // Move the pointers
        left++;
        right--;
    }

    // Check if the sum of squared digits is divisible by 9
    return (sum % 9 == 0);
}

int main() {
    int t;
    cin >> t;
    while(t--) {
        string n;
        cin >> n;
        
        int digit_sum = 0;
        for (char c : n) {
            digit_sum += c - '0';  // Sum of digits
        }

        // Check if the sum of digits is divisible by 9
        if (digit_sum % 9 == 0) {
            cout << "YES" << endl;
        } else {
            // If not, try the 'solve' method
            if (solve(n)) {
                cout << "YES" << endl;
            } else {
                cout << "NO" << endl;
            }
        }
    }
    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>
using namespace std;

bool solve(string n) {
    int sum = 0;
    // Iterate through the digits, squaring the relevant digits
    for (char c : n) {
        int digit = c - '0';
        if (digit == 2) {
            sum += 4;  // 2^2 = 4
        } else if (digit == 3) {
            sum += 9;  // 3^2 = 9
        } else {
            sum += digit;  // Other digits remain unchanged
        }
    }

    // Check if the sum of squared digits is divisible by 9
    return (sum % 9 == 0);
}

int main() {
    int t;
    cin >> t;
    while(t--) {
        string n;
        cin >> n;
        
        // Step 1: Sum the digits first
        int digit_sum = 0;
        for (char c : n) {
            digit_sum += c - '0';  // Sum of digits
        }

        // Step 2: Check if the sum of digits is divisible by 9
        if (digit_sum % 9 == 0) {
            cout << "YES" << endl;
        } else {
            // Step 3: Call solve() to check if we can make it divisible by 9
            if (solve(n)) {
                cout << "YES" << endl;
            } else {
                cout << "NO" << endl;
            }
        }
    }
    return 0;
}


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

#define ll long long
const int N = 3e5+10;
ll poss[15], poss2[15];

void solve() {
	int sum = 0;
	string s;
	cin >> s;
	poss[0] = 1;
	for(char c : s) {
		int k = c - '0';
		sum = (sum + k) % 9;
		if(k == 1 || k*k > 9)
			continue;
		int kk = k * k;
		int nw = (-k + kk / 10 + kk % 10 + 999) % 9;
		for(int j = 8; j >= 0; j--)
			poss2[(j+nw) % 9] = poss[j];
		for(int j = 0; j < 9; j++) 
			poss[j] |= poss2[j];
	}
	if(poss[(9 - sum) % 9])
		cout << "YES\n";
	else
		cout << "NO\n";
	for(int i = 0; i < 9; i++)
		poss[i] = 0;
}

int main() {
	int t;
	cin >> t;
	while(t--) {
		solve();
	}
}
Problem: 2060D - Subtract Min Sort
Language: PyPy 3

Previous submission (verdict: Compilation error):
 num = int(input())



for _ in range(num):

    eh_possivel = True

    tam_array = int(input()) 

    lista = list(map(int, input().split()))

 

    for i in range(len(lista) - 1):

        menor = min(lista[i], lista[i + 1])

        lista[i] = lista[i] - menor

        lista[i + 1] = lista[i + 1] - menor

        if lista[i] > lista[i + 1]:

            eh_possivel = False

            break 

    if eh_possivel:

        print("YES")

    else:

        print("NO")







Submission (verdict: Accepted):
num = int(input())



for _ in range(num):

    eh_possivel = True

    tam_array = int(input()) 

    lista = list(map(int, input().split()))

 

    for i in range(len(lista) - 1):

        menor = min(lista[i], lista[i + 1])

        lista[i] = lista[i] - menor

        lista[i + 1] = lista[i + 1] - menor

        if lista[i] > lista[i + 1]:

            eh_possivel = False

            break 

    if eh_possivel:

        print("YES")

    else:

        print("NO")
Problem: 2060D - Subtract Min Sort
Language: PyPy 3


Submission (verdict: Time limit exceeded on test 4):


num = int(input())



for _ in range(num):



    tam_array = int(input()) 

    lista = list(map(int, input().split()))



    conta = 1

    while conta != len(lista):

        for i in range(len(lista) - 1):

            menor = min(lista[i], lista[i + 1])

            lista[i] = lista[i] - menor

            lista[i + 1] = lista[i + 1] - menor

            conta += 1 

            if lista == sorted(lista):

                conta = len(lista)

                break 

    if lista == sorted(lista):

        print("YES")

    else:

        print("NO")
Problem: 2060D - Subtract Min Sort
Language: PyPy 3

Previous submission (verdict: Time limit exceeded on test 4):


num = int(input())



for _ in range(num):



    tam_array = int(input()) 

    lista = list(map(int, input().split()))



    conta = 1

    while conta != len(lista):

        for i in range(len(lista) - 1):

            menor = min(lista[i], lista[i + 1])

            lista[i] = lista[i] - menor

            lista[i + 1] = lista[i + 1] - menor

            conta += 1 

            if lista == sorted(lista):

                conta = len(lista)

                break 

    if lista == sorted(lista):

        print("YES")

    else:

        print("NO")





    

Submission (verdict: Compilation error):
 num = int(input())



for _ in range(num):

    eh_possivel = True

    tam_array = int(input()) 

    lista = list(map(int, input().split()))

 

    for i in range(len(lista) - 1):

        menor = min(lista[i], lista[i + 1])

        lista[i] = lista[i] - menor

        lista[i + 1] = lista[i + 1] - menor

        if lista[i] > lista[i + 1]:

            eh_possivel = False

            break 

    if eh_possivel:

        print("YES")

    else:

        print("NO")
Problem: 2050E - Three Strings
Language: C++17 (GCC 7-32)

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

int solve(string &a, string &b, string &c){
    int n = a.size(), m = b.size();
    vector<vector<int>> dp(n,vector<int>(m,INT_MAX));
    dp[0][0]=0;
    for(int i=1;i<n;i++){
        dp[i][0] = dp[i-1][0] + (a[i]!=c[i]);
    }
    for(int j=1;j<m;j++){
        dp[0][j] = dp[0][j-1] + (b[j]!=c[j]);
    }
    for(int i=1;i<n;i++){
        for(int j=1;j<m;j++){
            int ta = (a[i]!=c[i+j]),
                tb = (b[j]!=c[i+j]);
            dp[i][j] = min(dp[i-1][j]+ta,dp[i][j-1]+tb);
        }
    }
    return dp[n-1][m-1];
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int t;
    cin>>t;
    while(t--){
        string a,b,c;
        cin>>a>>b>>c;
        cout<<solve(a,b,c)<<"\n";
    }

    return 0;
}

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

int solve(string &a, string &b, string &c){
    int n = a.size(), m = b.size();
    vector<vector<int>> dp(n+1,vector<int>(m+1,INT_MAX));
    dp[0][0]=0;
    for(int i=1;i<n;i++){
        dp[i][0] = dp[i-1][0] + (a[i-1]!=c[i-1]);
    }
    for(int j=1;j<m;j++){
        dp[0][j] = dp[0][j-1] + (b[j-1]!=c[j-1]);
    }
    for(int i=1;i<n;i++){
        for(int j=1;j<m;j++){
            int ta = (a[i-1]!=c[i+j-1]),
                tb = (b[j-1]!=c[i+j-1]);
            dp[i][j] = min(dp[i-1][j]+ta,dp[i][j-1]+tb);
        }
    }
    return dp[n][m];
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int t;
    cin>>t;
    while(t--){
        string a,b,c;
        cin>>a>>b>>c;
        cout<<solve(a,b,c)<<"\n";
    }

    return 0;
}
Problem: 2050E - Three Strings
Language: C++17 (GCC 7-32)

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

int solve(string &a, string &b, string &c){
    int n = a.size(), m = b.size();
    vector<vector<int>> dp(n+1,vector<int>(m+1,INT_MAX));
    dp[0][0]=0;
    for(int i=1;i<n;i++){
        dp[i][0] = dp[i-1][0] + (a[i-1]!=c[i-1]);
    }
    for(int j=1;j<m;j++){
        dp[0][j] = dp[0][j-1] + (b[j-1]!=c[j-1]);
    }
    for(int i=1;i<n;i++){
        for(int j=1;j<m;j++){
            int ta = (a[i-1]!=c[i+j-1]),
                tb = (b[j-1]!=c[i+j-1]);
            dp[i][j] = min(dp[i-1][j]+ta,dp[i][j-1]+tb);
        }
    }
    return dp[n][m];
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int t;
    cin>>t;
    while(t--){
        string a,b,c;
        cin>>a>>b>>c;
        cout<<solve(a,b,c)<<"\n";
    }

    return 0;
}

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

int solve(string &a, string &b, string &c){
    int n = a.size(), m = b.size();
    vector<vector<int>> dp(n+1,vector<int>(m+1,INT_MAX));
    dp[0][0]=0;
    for(int i=0;i<n;i++){
        dp[i+1][0] = dp[i][0] + (a[i]!=c[i]);
    }
    for(int j=0;j<m;j++){
        dp[0][j+1] = dp[0][j] + (b[j]!=c[j]);
    }
    for(int i=0;i<n;i++){
        for(int j=0;j<m;j++){
            int ta = (a[i]!=c[i+j]),
                tb = (b[j]!=c[i+j]);
            dp[i+1][j+1] = min(dp[i][j+1]+ta,dp[i+1][j]+tb);
        }
    }
    return dp[n][m];
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int t;
    cin>>t;
    while(t--){
        string a,b,c;
        cin>>a>>b>>c;
        cout<<solve(a,b,c)<<"\n";
    }

    return 0;
}
Problem: 2050E - Three Strings
Language: C++17 (GCC 7-32)

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

int solve(string &a, string &b, string &c){
    int n = a.size(), m = b.size();
    vector<vector<int>> dp(n+1,vector<int>(m+1,INT_MAX));
    dp[0][0]=0;
    for(int i=0;i<n;i++){
        dp[i+1][0] = dp[i][0] + (a[i]!=c[i]);
    }
    for(int j=0;j<m;j++){
        dp[0][j+1] = dp[0][j] + (b[j]!=c[j]);
    }
    for(int i=0;i<n;i++){
        for(int j=0;j<m;j++){
            int ta = (a[i]!=c[i+j]),
                tb = (b[j]!=c[i+j]);
            dp[i+1][j+1] = min(dp[i][j+1]+ta,dp[i+1][j]+tb);
        }
    }
    return dp[n][m];
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int t;
    cin>>t;
    while(t--){
        string a,b,c;
        cin>>a>>b>>c;
        cout<<solve(a,b,c)<<"\n";
    }

    return 0;
}

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

int solve(string &a, string &b, string &c){
    int n = a.size(), m = b.size();
    vector<vector<int>> dp(n+1,vector<int>(m+1,INT_MAX));
    // Base case initialization
    dp[0][0] = 0;
    for (int i = 1; i <= n; i++) {
        dp[i][0] = dp[i - 1][0] + (a[i - 1] != c[i - 1]);
    }
    for (int j = 1; j <= m; j++) {
        dp[0][j] = dp[0][j - 1] + (b[j - 1] != c[j - 1]);
    }

    // Fill the DP table
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= m; j++) {
            int ta = (a[i - 1] != c[i + j - 1]);  // Cost if we take a[i-1]
            int tb = (b[j - 1] != c[i + j - 1]);  // Cost if we take b[j-1]
            dp[i][j] = min(dp[i - 1][j] + ta, dp[i][j - 1] + tb);
        }
    }

    return dp[n][m];
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int t;
    cin>>t;
    while(t--){
        string a,b,c;
        cin>>a>>b>>c;
        cout<<solve(a,b,c)<<"\n";
    }

    return 0;
}
Problem: 2050E - Three Strings
Language: C++17 (GCC 7-32)

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

string solve(string &a, string &b, string &c){
    int n = a.size(), m = b.size();
    vector<vector<int>> dp(n,vector<int>(m,INT_MAX));
    dp[0][0]=0;
    for(int i=1;i<n;i++){
        dp[i][0] = dp[i-1][0] + (a[i]!=c[i]);
    }
    for(int j=1;j<m;j++){
        dp[0][j] = dp[0][j-1] + (b[j]!=c[j]);
    }
    for(int i=1;i<n;i++){
        for(int j=1;j<m;j++){
            int ta = (a[i]!=c[i+j]),
                tb = (b[j]!=c[i+j]);
            dp[i][j] = min(dp[i-1][j]+ta,dp[i][j-1]+tb);
        }
    }
    return dp[n-1][m-1];
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int t;
    cin>>t;
    while(t--){
        string a,b,c;
        cin>>a>>b>>c;
        cout<<solve(a,b,c)<<"\n";
    }

    return 0;
}

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

int solve(string &a, string &b, string &c){
    int n = a.size(), m = b.size();
    vector<vector<int>> dp(n,vector<int>(m,INT_MAX));
    dp[0][0]=0;
    for(int i=1;i<n;i++){
        dp[i][0] = dp[i-1][0] + (a[i]!=c[i]);
    }
    for(int j=1;j<m;j++){
        dp[0][j] = dp[0][j-1] + (b[j]!=c[j]);
    }
    for(int i=1;i<n;i++){
        for(int j=1;j<m;j++){
            int ta = (a[i]!=c[i+j]),
                tb = (b[j]!=c[i+j]);
            dp[i][j] = min(dp[i-1][j]+ta,dp[i][j-1]+tb);
        }
    }
    return dp[n-1][m-1];
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int t;
    cin>>t;
    while(t--){
        string a,b,c;
        cin>>a>>b>>c;
        cout<<solve(a,b,c)<<"\n";
    }

    return 0;
}
Problem: 2050E - Three Strings
Language: C++17 (GCC 7-32)


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

string solve(string &a, string &b, string &c){
    int n = a.size(), m = b.size();
    vector<vector<int>> dp(n,vector<int>(m,INT_MAX));
    dp[0][0]=0;
    for(int i=1;i<n;i++){
        dp[i][0] = dp[i-1][0] + (a[i]!=c[i]);
    }
    for(int j=1;j<m;j++){
        dp[0][j] = dp[0][j-1] + (b[j]!=c[j]);
    }
    for(int i=1;i<n;i++){
        for(int j=1;j<m;j++){
            int ta = (a[i]!=c[i+j]),
                tb = (b[j]!=c[i+j]);
            dp[i][j] = min(dp[i-1][j]+ta,dp[i][j-1]+tb);
        }
    }
    return dp[n-1][m-1];
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int t;
    cin>>t;
    while(t--){
        string a,b,c;
        cin>>a>>b>>c;
        cout<<solve(a,b,c)<<"\n";
    }

    return 0;
}
Problem: 2050D - Digital string maximization
Language: Java 21


Submission (verdict: Wrong answer on test 2):
import java.util.*;



public class Main {

public static void main(String[] args) {

Scanner sc = new Scanner(System.in);

int t = sc.nextInt();



while(t-- > 0) {

String s = sc.next();

List<Integer> sb = new ArrayList<>();

for(int i = 0; i < s.length(); i++) sb.add((int) s.charAt(i) - '0');



int smallest = sb.getFirst();

int index = 1;

while(index < sb.size()) {

if(sb.get(index) != 0) {

if (sb.get(index) > smallest) {

int toPlace = index - 1;

int subtract = 1;

while (toPlace >= 0 && sb.get(index) - subtract > sb.get(toPlace)) {

if (toPlace == 0) break;

toPlace--;

subtract++;

}

if(sb.get(index) - subtract <= sb.get(toPlace)) {

toPlace++;

subtract--;

}

if (toPlace != index) {

int res = sb.get(index) - subtract;

sb.add(toPlace, res);

sb.remove(index + 1);

}

} else {

smallest = sb.get(index);

}

}

index++;

}



for(int e: sb) System.out.print(e);

System.out.print("\n");

}

}

}
Problem: 2050D - Digital string maximization
Language: Java 21

Previous submission (verdict: Wrong answer on test 2):
import java.util.*;



public class Main {

public static void main(String[] args) {

Scanner sc = new Scanner(System.in);

int t = sc.nextInt();



while(t-- > 0) {

String s = sc.next();

List<Integer> sb = new ArrayList<>();

for(int i = 0; i < s.length(); i++) sb.add((int) s.charAt(i) - '0');



int smallest = sb.getFirst();

int index = 1;

while(index < sb.size()) {

if(sb.get(index) != 0) {

if (sb.get(index) > smallest) {

int toPlace = index - 1;

int subtract = 1;

while (toPlace >= 0 && sb.get(index) - subtract > sb.get(toPlace)) {

if (toPlace == 0) break;

toPlace--;

subtract++;

}

if(sb.get(index) - subtract <= sb.get(toPlace)) {

toPlace++;

subtract--;

}

if (toPlace != index) {

int res = sb.get(index) - subtract;

sb.add(toPlace, res);

sb.remove(index + 1);

}

} else {

smallest = sb.get(index);

}

}

index++;

}



for(int e: sb) System.out.print(e);

System.out.print("\n");

}

}

}

Submission (verdict: Time limit exceeded on test 7):
import java.util.*;



public class Main {

public static void main(String[] args) {

Scanner sc = new Scanner(System.in);

int t = sc.nextInt();



while(t-- > 0) {

String s = sc.next();

List<Integer> sb = new ArrayList<>();

for(int i = 0; i < s.length(); i++) sb.add((int) s.charAt(i) - '0');



int index = 1;

while(index < sb.size()) {

if(sb.get(index) != 0) {

int toPlace = index - 1;

int subtract = 1;

while (toPlace >= 0 && sb.get(index) - subtract > sb.get(toPlace)) {

if (toPlace == 0) break;

toPlace--;

subtract++;

}

if(sb.get(index) - subtract <= sb.get(toPlace)) {

toPlace++;

subtract--;

}

if (toPlace != index) {

int res = sb.get(index) - subtract;

sb.add(toPlace, res);

sb.remove(index + 1);

}

}

index++;

}



for(int e: sb) System.out.print(e);

System.out.print("\n");

}

}

}
Problem: 2050D - Digital string maximization
Language: Java 21

Previous submission (verdict: Time limit exceeded on test 7):
import java.util.*;



public class Main {

public static void main(String[] args) {

Scanner sc = new Scanner(System.in);

int t = sc.nextInt();



while(t-- > 0) {

String s = sc.next();

List<Integer> sb = new ArrayList<>();

for(int i = 0; i < s.length(); i++) sb.add((int) s.charAt(i) - '0');



int index = 1;

while(index < sb.size()) {

if(sb.get(index) != 0) {

int toPlace = index - 1;

int subtract = 1;

while (toPlace >= 0 && sb.get(index) - subtract > sb.get(toPlace)) {

if (toPlace == 0) break;

toPlace--;

subtract++;

}

if(sb.get(index) - subtract <= sb.get(toPlace)) {

toPlace++;

subtract--;

}

if (toPlace != index) {

int res = sb.get(index) - subtract;

sb.add(toPlace, res);

sb.remove(index + 1);

}

}

index++;

}



for(int e: sb) System.out.print(e);

System.out.print("\n");

}

}

}

Submission (verdict: Accepted):
import java.util.*;



public class Main {

public static void main(String[] args) {

Scanner sc = new Scanner(System.in);

int t = sc.nextInt();



while (t-- > 0) {

char[] sb = sc.next().toCharArray(); // Using char array for efficiency

int n = sb.length;



int index = 1;

while (index < n) {

if (sb[index] != '0') {

int toPlace = index - 1;

int subtract = 1;



while (toPlace >= 0 && (sb[index] - '0') - subtract > (sb[toPlace] - '0')) {

if (toPlace == 0) break;

toPlace--;

subtract++;

}



if ((sb[index] - '0') - subtract <= (sb[toPlace] - '0')) {

toPlace++;

subtract--;

}



if (toPlace != index) {

char res = (char) ((sb[index] - '0' - subtract) + '0');



// Shift elements manually instead of using `add()` and `remove()`

for (int j = index; j > toPlace; j--) {

sb[j] = sb[j - 1];

}

sb[toPlace] = res;

}

}

index++;

}



System.out.println(new String(sb)); // Fast output

}

}

}
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;
typedef long long ll;

ll binary_to_ll(string s){
    ll n = 0;
    for (int i = 0; i < s.size(); i++)
    {
        n *= 2;
        n += (s[i]-'0');
    }
    return n;
}


int main(void){
    // ios::sync_with_stdio(false), cin.tie(nullptr);
    int t; cin >> t;
    while (t--)
    {
        ll l,r; cin >> l >> r;
        ll a=r-2,b=r-1,c=r;
        string temp = bitset<64>(r).to_string();
        int size = 64-temp.find('1');
        string masked = string(size,'0');
        // for (int i = l; i <= r; i++)
        // {
        //     cout << i << ": " << bitset<64>(i).to_string() << endl;
        // }

        string l_str = bitset<64>(r).to_string();
        string r_str = bitset<64>(l).to_string();

        int distinct_bit = 0;
        string a_Str = "";
        for (int i = 0; i < 64; i++)
        {
            if(l_str[i] != r_str[i]){
                distinct_bit = i;
                break;
            }else{
                a_Str += l_str[i];
            }
        }

        a = binary_to_ll(a_Str+"0"+string(63-distinct_bit,'1'));
        b = a+1;
        if(min(r,a+b) != b){
            c = min(r,a+b);
        }else{
            c = max(l,1LL);
        }


        // for (int i = 0; i < masked.size(); i++)
        // {
        //     masked[i] = '1';
        //     ll toFind = binary_to_ll(masked);
        //     if(toFind <= r && toFind >= l+2){
        //         a = toFind;
        //         b = a-1;
        //         c = a-2;
        //         break;
        //     }
        // }
        // cout << "?" << (a^b)+(b^c)+(c^a) << endl;
        // ll a1[3];
        // for (int i = 0; i < 3; i++)
        // {
        //     cin >> a1[i];
        // }
        // cout << "?" << (a1[0]^a1[1])+(a1[2]^a1[1])+(a1[2]^a1[0]) << endl;
        cout << a << " " << b << " " << c << " \n";
    }
    return 0;
}
// auto print = [](std::ostream& os, auto... args) {
// ((os << args << " "), ...) << std::endl; // Fold expression
// };
// print(std::cout, a, b, c);

/*

i want to find three numbers such that most of their bits don't match, right? yes!

let's try this with only 2 numbers

0 and 8


0001
0010
0011

0100
0101
0110
0111
1000

0 and 8 will give me the highest xor if only two numbers are to be considered

0 and 8, the other highest needs to be considered now


a*(b+c) + b*c - this wont work


*/