結果

問題 No.184 たのしい排他的論理和(HARD)
ユーザー h_nosonh_noson
提出日時 2016-03-15 19:34:33
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 879 bytes
コンパイル時間 476 ms
コンパイル使用メモリ 63,656 KB
実行使用メモリ 4,508 KB
最終ジャッジ日時 2023-09-17 17:27:27
合計ジャッジ時間 4,586 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
4,376 KB
testcase_01 AC 23 ms
4,380 KB
testcase_02 AC 111 ms
4,376 KB
testcase_03 WA -
testcase_04 AC 89 ms
4,380 KB
testcase_05 AC 89 ms
4,384 KB
testcase_06 AC 20 ms
4,376 KB
testcase_07 AC 89 ms
4,376 KB
testcase_08 AC 75 ms
4,376 KB
testcase_09 AC 23 ms
4,380 KB
testcase_10 AC 60 ms
4,384 KB
testcase_11 AC 45 ms
4,380 KB
testcase_12 AC 86 ms
4,396 KB
testcase_13 AC 92 ms
4,376 KB
testcase_14 AC 56 ms
4,388 KB
testcase_15 AC 98 ms
4,376 KB
testcase_16 AC 84 ms
4,380 KB
testcase_17 AC 90 ms
4,380 KB
testcase_18 AC 2 ms
4,380 KB
testcase_19 AC 16 ms
4,380 KB
testcase_20 AC 36 ms
4,380 KB
testcase_21 AC 101 ms
4,380 KB
testcase_22 AC 101 ms
4,424 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 99 ms
4,376 KB
testcase_34 AC 97 ms
4,380 KB
testcase_35 AC 101 ms
4,380 KB
testcase_36 AC 100 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

#define RREP(i,s,e) for (i = s; i >= e; i--)
#define rrep(i,n) RREP(i,n,0)
#define REP(i,s,e) for (i = s; i < e; i++)
#define rep(i,n) REP(i,0,n)
#define INF 1e8

typedef long long ll;

int main() {
    int i, j, k, n;
    bitset<100000> bs[61] {};
    cin >> n;
    rep (i,n) {
        ll a;
        cin >> a;
        rep (j,61) bs[j][i] = a&(1LL<<j);
    }
    rep (i,61) {
        int mn = 100000;
        REP (j,i,61) {
            for (k = 0; k < 100000 && !bs[j][k]; k++);
            if (k < mn) {
                swap(bs[i],bs[k]);
                mn = k;
            }
        }
        if (mn == 100000)
            break;
        REP (j,i+1,61) {
            if (bs[j][mn])
                bs[j] ^= bs[i];
        }
    }
    cout << (1LL << i) << endl;
    return 0;
}
0