ORTUPLES

PHOTO EMBED

Sat Sep 10 2022 13:21:42 GMT+0000 (Coordinated Universal Time)

Saved by @Ranjan_kumar

#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    
    ll t, p, q, r, ans, i, j;
    
    cin>>t;
    
    for(;t--;)
    {
        cin>>p>>q>>r;
        
        ll c[21];
        
        for(i=0; i<=20; i++){
            c[i]=0;
        }
        
        for(i=0; i<20; i++)
        {
            c[i]=c[i]+(p%2)+(q%2)+(r%2);
            p/=2;
            q/=2;
            r/=2;
        }
        
        ans=1;
        
        for(i=0; i<20; i++)
        {
            if(c[i]==1){
                ans=0;
                break;
            }else if(c[i]==3){
                ans=ans*4;
            }
        }
        cout<<ans<<"\n";
    }
    
}
content_copyCOPY

https://youtu.be/zr3o9kDtcf8

https://www.codechef.com/submit/ORTUPLES