1 solutions

  • 2
    @ 2025-7-10 16:01:57

    遇事不绝,暴力美学!

    #include <bits/stdc++.h>
    using namespace std;
    #define int long long
    int n, ans;
    
    signed main() {
    	cin >> n;
    	for (int i = 0; i <= n; i++) {
    		if ((i ^ (2 * i) ^ (3 * i)) == 0) {
    			ans++;
    		}
    	}
    	cout << ans;
    	return 0;
    }
    

    Information

    ID
    312
    Time
    1000ms
    Memory
    64MiB
    Difficulty
    8
    Tags
    # Submissions
    17
    Accepted
    5
    Uploaded By