結果
問題 | No.2939 Sigma Popcount Problem |
ユーザー |
|
提出日時 | 2024-10-18 21:49:49 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 336 bytes |
コンパイル時間 | 2,020 ms |
コンパイル使用メモリ | 191,568 KB |
最終ジャッジ日時 | 2025-02-24 20:39:10 |
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | WA * 18 |
ソースコード
#include <bits/stdc++.h>using namespace std;using ll = long long;void solve() {ll x;cin >> x;ll ans = 0;int lg = 0;while ((x >> lg)) lg ++;lg --;ans += (x - (1ll << lg)) + 1;for (int d = 0; d < lg; d ++) {ans += (1ll << (lg - 1));}cout << ans << endl;}int main () {int N;cin >> N;while (N--) solve();}