結果
問題 |
No.1255 ハイレーツ・オブ・ボリビアン
|
ユーザー |
|
提出日時 | 2020-10-09 22:32:24 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 447 bytes |
コンパイル時間 | 473 ms |
コンパイル使用メモリ | 65,620 KB |
最終ジャッジ日時 | 2025-01-15 05:16:35 |
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 7 TLE * 8 |
ソースコード
#include <iostream> void solve() { int n; std::cin >> n; n = n * 2 - 1; auto m = n; int ans = 0; while (true) { int k = __builtin_ctz(m + 1); ans += k; m >>= k; if (m == 0) break; m += n; } 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; }