結果

問題 No.1255 ハイレーツ・オブ・ボリビアン
ユーザー Mister
提出日時 2020-10-09 22:22:45
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 391 bytes
コンパイル時間 468 ms
コンパイル使用メモリ 66,072 KB
最終ジャッジ日時 2025-01-15 05:06:13
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 7 TLE * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

void solve() {
    int n;
    std::cin >> n;
    n = n * 2 - 1;

    auto m = n;
    int ans = 0;
    while (m != 0) {
        if (~m & 1) m += n;
        ++ans;
        m >>= 1;
    }

    std::cout << ans << "\n";
}

int main() {
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);

    int q;
    std::cin >> q;
    while (q--) solve();

    return 0;
}
0