题解 | 【模板】位运算Ⅰ ‖ 整体与、或、异或

【模板】位运算Ⅰ ‖ 整体与、或、异或

https://www.nowcoder.com/practice/cf1aea70e6e646b48b1c5fd2705c624e

#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using ld = long double;
using PII=pair<ll,ll>;
using PIII=pair<int,pair<int,int>>;
const ld ESP = 1e-10;
const ld PI = acosl(-1);
const int N=1e6+10;
const int M=2e5+10;
// const int mod = 1000000007;
const int mod = 998244353;
//随机化
random_device rd;
mt19937 gen(rd());
uniform_int_distribution<> dis(1, 1000000000);

void solve(){
    ll x,y;
    cin>>x>>y;
    cout<<(x|y)<<" "<<(x&y)<<" "<<(x^y)<<'\n';
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int _=1;
    cin>>_;
    while(_--){
        solve();
    }
    return 0;
}


全部评论

相关推荐

10-17 09:06
门头沟学院 Java
8527睿:有些地方感觉不太契合实际啊。简单看看第二个项目那里。 比如canal流式读取数据库日志进行缓存同步那里。可不可以加个消息中间件来确保SQL语句的削峰填谷。一般都是canal+消息中间件 双层鉴权登录那里,描述有点模糊,登录是鉴权的前提唉,后面功能都在说是登录,鉴权没有啊
点赞 评论 收藏
分享
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务