結果

問題 No.589 Counting Even
ユーザー kurenai3110
提出日時 2017-11-03 22:52:08
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 309 bytes
コンパイル時間 474 ms
コンパイル使用メモリ 58,588 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-22 16:13:32
合計ジャッジ時間 1,434 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 8 WA * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;

int main()
{
	long long N; cin >> N;

	long long ans = 0;
	if (N) {
		int cnt = 0;
		while (N) {
			ans += !(N & 1) * ((long long)1 << cnt);
			N >>= 1;
			cnt++;
		}
	}
	cout << ans << endl;

    return 0;
}

0