結果
| 問題 |
No.589 Counting Even
|
| コンテスト | |
| ユーザー |
kurenai3110
|
| 提出日時 | 2017-11-03 23:40:27 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 289 bytes |
| コンパイル時間 | 550 ms |
| コンパイル使用メモリ | 60,588 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-23 15:06:31 |
| 合計ジャッジ時間 | 1,535 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 29 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
int main()
{
long long N; cin >> N;
long long ans = N;
int cnt = 0;
while (N) {
if (N & 1)cnt++;
N >>= 1;
}
ans -= ((long long)1 << cnt) - 1;
cout << ans << endl;
return 0;
}
kurenai3110