結果
| 問題 |
No.589 Counting Even
|
| コンテスト | |
| ユーザー |
vjudge1
|
| 提出日時 | 2025-08-23 21:15:20 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 571 bytes |
| コンパイル時間 | 2,670 ms |
| コンパイル使用メモリ | 275,472 KB |
| 実行使用メモリ | 7,716 KB |
| 最終ジャッジ日時 | 2025-08-23 21:15:24 |
| 合計ジャッジ時間 | 3,733 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 29 |
ソースコード
#include <bits/stdc++.h>
#define int long long
//#define USE_FREOPEN
//#define MUL_TEST
#define FILENAME "even"
using namespace std;
void solve() {
int n;
cin >> n;
int tn = n, minus = 1;
while (tn) {
if (tn & 1) minus *= 2;
tn /= 2;
}
cout << n + 1 - minus << '\n';
}
signed main() {
ios::sync_with_stdio(false);
cin.tie(nullptr); cout.tie(nullptr);
#ifdef USE_FREOPEN
freopen(FILENAME ".in", "r", stdin);
freopen(FILENAME ".out", "w", stdout);
#endif
int _ = 1;
#ifdef MUL_TEST
cin >> _;
#endif
while (_--)
solve();
_^=_;
return 0^_^0;
}
vjudge1