結果

問題 No.589 Counting Even
ユーザー 0x19f
提出日時 2017-11-04 16:12:02
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 266 bytes
コンパイル時間 1,631 ms
コンパイル使用メモリ 159,804 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-23 17:55:17
合計ジャッジ時間 2,475 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10 WA * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define REP(i, a, n) for(ll i = ((ll) a); i < ((ll) n); i++)
using namespace std;
typedef long long ll;

int main(void) {
  ll N;
  cin >> N;

  ll cnt = 0;
  REP(i, 0, 63) if(N & (1LL << i)) cnt++;

  cout << N + 1 - pow(2, cnt) << endl;
}
0