Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ORTUPLES from Codechef #1121

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions Codechef/ORTUPLES.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#include <bits/stdc++.h>
#define cinarr(a,n) for(int i = 0; i < n; i++) cin >> a[i]
#define coutarr(a) for(int i = 0; i < n; i++) cout << a[i] <<endl
#define intin(x) int x ; cin >> x ;
#define strin(x) string x ; cin >> x ;
#define print(x) cout << x <<endl ;
#define loop(i,a,n) for (int i=a;i<n;i++)
#define ll long long
#define int long long
#define YES cout << "Yes" <<endl ;
#define NO cout << "No" <<endl ;
#define endl "\n" ;
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define ff first
#define ss second
#define pb push_back
#define vi vector<int>
#define qi queue<int>
#define mii map<int,int>
#define pii pair<int,int>
#define mip map<int,pair<int,int>>
#define SYNC ios_base::sync_with_stdio(false); cin.tie(NULL)
using namespace std;
//Smuggler
//My Will is Eternal
const int N =32768;
//------------------------------------------------------xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx--------------------------------------------------------------------------------------------








void solve ()
{
int p,q,r ;
cin >> p >> q >>r ;

int sum= 1 ;

loop (i,0,30)
{
int x = ((p>>i)&1 ) + ((q>>i)&1 ) + ((r>>i)&1 ) ;
// cout <<x <<endl ;
if (x==3)
{
sum*=4 ;
}
else if (x==1)
{
sum=0 ;
break ;
}

}
cout <<sum <<endl ;

}
signed main()
{ SYNC ;
// #ifndef ONLINE_JUDGE
// freopen("shell.in", "r", stdin);
// freopen("shell.out", "w", stdout);
// #endif
int t =1;
cin >> t;
while (t--)
{
solve() ;
}
return 0 ;
}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ In this repository, you can find the solutions (as source code) for the problems
| [Nauman Chaudhary](https://github.com/nauman-chaudhary) <br> <img src="https://github.com/nauman-chaudhary.png" width="100" height="100"> | Pakistan | Python | |
| [Gourav Rusiya](https://github.com/GouravRusiya30) <br> <img src="https://github.com/GouravRusiya30.png" width="100" height="100"> | India | Java | https://www.hackerrank.com/gouravrusiya786 |
| [Trushita Maurya](https://github.com/trushita23) <br> <img src="https://github.com/trushita23.png" width="100" height="100"> | India | Java
| [Chiranjibi Pradhan](https://github.com/chiranjibismg) <br> <img src="https://github.com/chiranjibismg.png" width="100" height="100"> | India | CPP |https://www.linkedin.com/in/chiranjibi-pradhan-724290224/

### License

[![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://github.com/ows-ali/Hacktoberfest/blob/master/LICENSE)