結果

問題 No.184 たのしい排他的論理和(HARD)
ユーザー fine
提出日時 2016-04-01 00:33:49
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 387 bytes
コンパイル時間 1,219 ms
コンパイル使用メモリ 157,556 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-04 12:09:29
合計ジャッジ時間 2,686 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    unsigned long long tmp, sum = 0LL;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> tmp;
        sum |= tmp;
    }
    bitset<61> x(sum);
    int c = x.count();
    unsigned long long ans = 1LL << min(c, n);
    cout << ans << "\n";
    return 0;
}
0