結果
| 問題 |
No.3276 Make Smaller Popcount
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-09-19 21:34:47 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 420 bytes |
| コンパイル時間 | 831 ms |
| コンパイル使用メモリ | 86,864 KB |
| 実行使用メモリ | 7,716 KB |
| 最終ジャッジ日時 | 2025-09-19 21:35:34 |
| 合計ジャッジ時間 | 14,365 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 25 WA * 3 |
ソースコード
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
using ll = long long;
void solve() {
ll N;cin >> N;
int K = 35;
ll res = 0;
for (int i = 0;i < K;i++) {
if (N & (1LL << i)) {
res |= (1LL << i);
for (int k = i+1;k < K;k++) {
if (N & (1LL << k)) break;
res |= (1LL << k);
}
cout << res << endl;
return;
}
}
}
int main() {
int t;cin >> t;
while (t--) solve();
}