結果

問題 No.184 たのしい排他的論理和(HARD)
ユーザー KosukekimKosukekim
提出日時 2020-10-29 11:18:44
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 100 ms / 5,000 ms
コード長 736 bytes
コンパイル時間 4,253 ms
コンパイル使用メモリ 226,132 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-29 03:58:18
合計ジャッジ時間 9,241 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,384 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 2 ms
4,504 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 71 ms
4,376 KB
testcase_09 AC 16 ms
4,384 KB
testcase_10 AC 55 ms
4,380 KB
testcase_11 AC 40 ms
4,380 KB
testcase_12 AC 83 ms
4,380 KB
testcase_13 AC 91 ms
4,376 KB
testcase_14 AC 52 ms
4,380 KB
testcase_15 AC 96 ms
4,380 KB
testcase_16 AC 81 ms
4,380 KB
testcase_17 AC 87 ms
4,380 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 1 ms
4,380 KB
testcase_20 AC 16 ms
4,380 KB
testcase_21 AC 100 ms
4,376 KB
testcase_22 AC 99 ms
4,380 KB
testcase_23 AC 1 ms
4,380 KB
testcase_24 AC 2 ms
4,380 KB
testcase_25 AC 1 ms
4,380 KB
testcase_26 AC 2 ms
4,380 KB
testcase_27 AC 2 ms
4,376 KB
testcase_28 AC 61 ms
4,380 KB
testcase_29 AC 85 ms
4,380 KB
testcase_30 AC 75 ms
4,380 KB
testcase_31 AC 65 ms
4,380 KB
testcase_32 AC 79 ms
4,380 KB
testcase_33 AC 97 ms
4,376 KB
testcase_34 AC 96 ms
4,384 KB
testcase_35 AC 99 ms
4,380 KB
testcase_36 AC 99 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
#include <string>
#include <vector>
#include <algorithm>
#define rep(i,n) for (int i = 0;i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define chmax(x,y) x = max(x,y)
using R=double;
using ld = long double;
int INF = 1e9;
ll LINF = 1e18;
int mod = 1000000007;
int mod2 = 1;
using graph = vector<vector<int>>;
using mint = modint1000000007;

int main(){
	int n;cin >> n;
	vector<ll> a(n);
	rep(i,n) cin >> a[i];
	int ans = 0;
	rep(i,n){
		if(a[i] == 0) continue;
		ans++;
		int x = 0;
		while(1LL<<(x+1) <= a[i]) x++;
		for(int j = i+1;j < n;j++){
			if(a[j] & (1LL<<x)) a[j] ^= a[i];
		}
	}

	cout << (1LL<< ans) << endl;  
}

0