What is problem in code for CHANDF for subtask one

https://www.codechef.com/viewsolution/32992244
pls help

1 Like

YOU MISSED THE CORNER CASE WHEN ANY ONE OF X OR Y IS ZERO …
ANSWER WILL BE ZERO IN THAT CASE

1 Like
int test_cases;
    cin>>test_cases;//test cases
    while(test_cases--)
        {
        unsigned long long int x,y,l,r;
        cin>>x>>y>>l>>r;
        if(!(x && y))
            cout<<"0"<<endl;
        else
            cout<<(x|y)<<endl;
        }
}
1 Like

https://www.codechef.com/viewsolution/33012772
also happen’s same thing pls find the error ???

1 Like

You wrote if(x==0 && y==0) but it should be if(x==0 || y==0)

2 Likes

ya thnxs i get my issue ):

1 Like