結果

問題 No.184 たのしい排他的論理和(HARD)
ユーザー cielciel
提出日時 2015-04-17 19:19:23
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 725 bytes
コンパイル時間 358 ms
コンパイル使用メモリ 50,496 KB
実行使用メモリ 31,544 KB
最終ジャッジ日時 2023-09-17 16:43:20
合計ジャッジ時間 6,692 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 186 ms
22,916 KB
testcase_09 AC 31 ms
6,928 KB
testcase_10 AC 127 ms
18,132 KB
testcase_11 AC 86 ms
13,704 KB
testcase_12 AC 235 ms
26,452 KB
testcase_13 AC 262 ms
28,548 KB
testcase_14 AC 121 ms
17,344 KB
testcase_15 AC 283 ms
30,536 KB
testcase_16 AC 226 ms
25,832 KB
testcase_17 AC 240 ms
27,692 KB
testcase_18 AC 1 ms
4,376 KB
testcase_19 AC 1 ms
4,380 KB
testcase_20 AC 85 ms
31,400 KB
testcase_21 AC 289 ms
31,344 KB
testcase_22 AC 282 ms
31,544 KB
testcase_23 AC 1 ms
4,376 KB
testcase_24 AC 1 ms
4,380 KB
testcase_25 AC 1 ms
4,376 KB
testcase_26 AC 2 ms
4,380 KB
testcase_27 AC 1 ms
4,376 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 291 ms
30,608 KB
testcase_34 AC 293 ms
30,340 KB
testcase_35 AC 302 ms
31,092 KB
testcase_36 AC 287 ms
31,064 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <vector>
#include <algorithm>
#include <cstdio>
#include <cmath>
using namespace std;

int gauss(vector<vector<int> > &a){
	if(a.empty())return 0;
	int w=a[0].size();
	int n=a.size();
	int ret=0;
	for(int i=0;i<min(n,w);i++){
		if(!a[i][i]){
			int j=0;
			for(;j<n;j++)if(i!=j){
				if(a[j][i]){
					for(int k=i;k<w;k++)a[i][k]^=a[j][k];
					break;
				}
			}
			if(j==n)continue;
		}
		for(int j=0;j<n;j++)if(i!=j){
			for(int k=i;k<w;k++)a[j][k]=a[j][k]^a[i][k];
		}
		ret++;
	}
	return ret;
}

int main(){
	int N;
	scanf("%d",&N);
	vector<vector<int> >v(N);
	for(int i=0;i<N;i++){
		v[i].resize(64);
		long long n;
		scanf("%lld",&n);
		for(int j=0;n;n/=2,j++)v[i][j]=n%2;
	}
	printf("%lld\n",1LL<<gauss(v));
}
0