結果
| 問題 | No.47 ポケットを叩くとビスケットが2倍 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-08-23 02:08:40 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 421 bytes |
| 記録 | |
| コンパイル時間 | 1,240 ms |
| コンパイル使用メモリ | 210,488 KB |
| 実行使用メモリ | 9,780 KB |
| 最終ジャッジ日時 | 2026-08-23 02:08:44 |
| 合計ジャッジ時間 | 2,845 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 3 WA * 18 |
ソースコード
#include <bits/stdc++.h>
using i64 = long long;
using u64 = unsigned long long;
using u32 = unsigned;
using u128 = unsigned __int128;
using i128 = __int128;
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int N;
std::cin >> N;
int ans = 0;
for (int i = 0; i < 31; i++) {
if ((N >> i) & 1) ans += i;
}
std::cout << ans + (N & 1) << '\n';
return 0;
}