Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Author: 曹北健(37509)
- Result: AC Submission_id: 4365351
- Created at: Wed Apr 20 2022 19:09:14 GMT+0800 (China Standard Time)
- Problem: 5594 Time: 11 Memory: 1628
- */
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- #include <string.h>
- #include <ctype.h>
- #include <time.h>
- #pragma warning(disable:4996)
- typedef long long LL;
- typedef unsigned long long ULL;
- #define GETBIT64(x,i) ((long long)(x)>>(long long)(i))&1ll
- LL gcd(LL a, LL b){
- return a % b ? gcd(b, a % b) : b;
- }
- int main(){
- #ifdef _DEBUG
- FILE *fp = freopen("../../../input.txt", "r", stdin);
- //FILE *fp2 = freopen("output.txt", "w", stdout);
- #endif // _DEBUG
- LL a, b, x1, x2, i, ans = 0;
- while(~scanf("%lld%lld", &a, &b)){
- ans = 0;
- for(i = 0; i < 64; i++){
- x1 = GETBIT64(a, i);
- x2 = GETBIT64(b, i);
- if(!((!x1) && x2)){
- ans |= (1ll << i);
- }
- }
- printf("%lld\n", ans);
- }
- #ifdef _DEBUG
- freopen("CON", "r", stdin);
- //freopen("CON", "w", stdout);
- system("pause");
- #endif // _DEBUG
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment