求证代码正确性
查看原帖
求证代码正确性
537934
litjohn楼主2024/11/23 20:46

rt。赛事的神秘找规律做法。

#include <bits/stdc++.h>

using namespace std;
int t;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> t;
    for (int _ = 0; _ < t; ++_) {
        unsigned long long k;
        cin >> k;
        if (k == 0) {
            cout << "NO!\n";
        } else {
            cout << __builtin_ctzll(k) + 1 << "\n";
        }
    }
    return 0;
}
2024/11/23 20:46
加载中...