2 solutions

  • 0
    @ 2025-3-24 16:33:09

    这个位运算是真的nb!

    #include<iostream>
    #include<cmath>
    #include<algorithm>
    #include<queue>
    #include<algorithm>
    #include<bits/stdc++.h>
    using namespace std;
    using ll = long long;
    const int N = 1e3+10;
    ll a[N][N],sum;
    int main()
    {
        // for(int i = 0;i < 32;i++)
        // {
        //     cout<<((i>>4) & 1) <<((i>>3) & 1)<<((i>>2) & 1)<<((i>>1) & 1)<<(i & 1)<<"\n";
        // }
        for(int i = 0;i < 32;i++)
        {
            bitset<5> b(i);
            cout<<b<<"\n";
        }
        return 0; 
    }
    
    

    Information

    ID
    1821
    Time
    1000ms
    Memory
    512MiB
    Difficulty
    2
    Tags
    # Submissions
    31
    Accepted
    22
    Uploaded By