7 条题解

  • 1
    @ 2026-2-11 14:44:57

    #include<bits/stdc++.h> using namespace std; #define int long long int p,q; int cnt,sum; signed main(){ cin>>p>>q; int ans=(p&q); while(ans!=0){ cnt++; if(ans%2){ cout<<cnt<<" "; sum++; } ans/=2; } if(sum==0){ cout<<0<<endl; } cout<<endl; if(sum>=2){ cout<<"Yes"<<endl; } else{ cout<<"NO"<<endl; } return 0; }

    小鸟

    信息

    ID
    2554
    时间
    1000ms
    内存
    256MiB
    难度
    7
    标签
    递交数
    987
    已通过
    222
    上传者