1 solutions

  • 2
    @ 2025-7-12 9:10:01

    longbit直接过

    #include <bits/stdc++.h>
    using namespace std;
    int n;
    
    int longbit(int x) {
    	return x & -x;
    }
    
    int main() {
    	while (cin >> n) {
    		if (n == 0) {
    			break;
    		}
    		cout << longbit(n) << "\n";
    	}
    	return 0;
    }
    
    • 1

    Information

    ID
    309
    Time
    1000ms
    Memory
    64MiB
    Difficulty
    9
    Tags
    # Submissions
    10
    Accepted
    8
    Uploaded By