結果

問題 No.184 たのしい排他的論理和(HARD)
ユーザー 沙耶花沙耶花
提出日時 2021-11-03 22:39:37
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 94 ms / 5,000 ms
コード長 793 bytes
コンパイル時間 4,149 ms
コンパイル使用メモリ 254,460 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-21 15:43:53
合計ジャッジ時間 7,621 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 66 ms
5,376 KB
testcase_09 AC 15 ms
5,376 KB
testcase_10 AC 51 ms
5,376 KB
testcase_11 AC 37 ms
5,376 KB
testcase_12 AC 80 ms
5,376 KB
testcase_13 AC 87 ms
5,376 KB
testcase_14 AC 50 ms
5,376 KB
testcase_15 AC 91 ms
5,376 KB
testcase_16 AC 76 ms
5,376 KB
testcase_17 AC 82 ms
5,376 KB
testcase_18 AC 1 ms
5,376 KB
testcase_19 AC 1 ms
5,376 KB
testcase_20 AC 19 ms
5,376 KB
testcase_21 AC 92 ms
5,376 KB
testcase_22 AC 94 ms
5,376 KB
testcase_23 AC 1 ms
5,376 KB
testcase_24 AC 2 ms
5,376 KB
testcase_25 AC 2 ms
5,376 KB
testcase_26 AC 1 ms
5,376 KB
testcase_27 AC 1 ms
5,376 KB
testcase_28 AC 55 ms
5,376 KB
testcase_29 AC 79 ms
5,376 KB
testcase_30 AC 69 ms
5,376 KB
testcase_31 AC 61 ms
5,376 KB
testcase_32 AC 73 ms
5,376 KB
testcase_33 AC 89 ms
5,376 KB
testcase_34 AC 93 ms
5,376 KB
testcase_35 AC 93 ms
5,376 KB
testcase_36 AC 90 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
using mint = modint;
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf 1000000001

vector<long long> func(vector<long long> A){
	int last = 0;
	for(long long i=60;i>=0;i--){
		int ind = -1;
		for(int j=last;j<A.size();j++){
			if((A[j]>>i) & 1LL){
				ind = j;
				break;
			}
		}
		if(ind==-1)continue;
		for(int j=0;j<A.size();j++){
			if(j!=ind){
				if((A[j]>>i)&1LL){
					A[j] ^= A[ind];
				}
			}
		}
		swap(A[last],A[ind]);
		last++;
	}
	while(A.size()!=0&&A.back()==0)A.pop_back();
	return A;
}

int main(){	
	
	int n;
	cin>>n;
	vector<long long> a(n);
	rep(i,n)cin>>a[i];
	
	a = func(a);
	
	long long ans = 1LL << a.size();
	
	cout<<ans<<endl;
	
	return 0;
	
}
0