結果
| 問題 |
No.589 Counting Even
|
| コンテスト | |
| ユーザー |
vjudge1
|
| 提出日時 | 2025-08-25 09:30:59 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 337 bytes |
| コンパイル時間 | 1,307 ms |
| コンパイル使用メモリ | 161,220 KB |
| 実行使用メモリ | 7,720 KB |
| 最終ジャッジ日時 | 2025-08-25 09:31:02 |
| 合計ジャッジ時間 | 2,582 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 25 WA * 4 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define int long long
int n, k;
signed main() {
ios::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
cin >> n;
for (int i = n; i; i >>= 1ll) k += (i & 1ll);
cout << n + 1 - (1 << k);
return 0;
}
/*
????????C n, k = \sum C (n >> i) & 1, (k >> i) & 1
n & k == 0 ?? 0
*/
vjudge1