結果

問題 No.589 Counting Even
ユーザー vjudge1
提出日時 2025-08-23 21:14:36
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 572 bytes
コンパイル時間 3,248 ms
コンパイル使用メモリ 275,308 KB
実行使用メモリ 7,720 KB
最終ジャッジ日時 2025-08-23 21:14:41
合計ジャッジ時間 4,435 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 5 WA * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0