結果
問題 | No.589 Counting Even |
ユーザー |
|
提出日時 | 2019-02-13 21:56:35 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 229 bytes |
コンパイル時間 | 520 ms |
コンパイル使用メモリ | 65,272 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-13 11:14:47 |
合計ジャッジ時間 | 1,675 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 29 |
ソースコード
#include<iostream>using namespace std;typedef long long ll;int main(){ll n;cin >> n;int cnt = 0;for(int i = 0; i < 60; i++) if((n>>i)&1) cnt++;cout << n + 1 - (1ll<<cnt) << endl;return 0;}