結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 209 ms
22,972 KB
testcase_09 AC 32 ms
6,900 KB
testcase_10 AC 135 ms
18,232 KB
testcase_11 AC 87 ms
13,732 KB
testcase_12 AC 245 ms
26,380 KB
testcase_13 AC 267 ms
28,576 KB
testcase_14 AC 123 ms
17,468 KB
testcase_15 AC 292 ms
30,576 KB
testcase_16 AC 241 ms
25,884 KB
testcase_17 AC 253 ms
27,716 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 1 ms
4,380 KB
testcase_20 AC 86 ms
31,364 KB
testcase_21 AC 301 ms
31,424 KB
testcase_22 AC 303 ms
31,412 KB
testcase_23 AC 2 ms
4,376 KB
testcase_24 WA -
testcase_25 AC 1 ms
4,376 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 296 ms
30,668 KB
testcase_34 AC 295 ms
30,300 KB
testcase_35 AC 297 ms
31,100 KB
testcase_36 AC 299 ms
31,132 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

//#include "inspect.hpp"
#include <vector>
#include <algorithm>
#include <cstdio>
#include <cmath>
using namespace std;

int gauss(vector<vector<int> > &a){
	if(a.empty())return 0;
	//cout<<a<<endl;
	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=i+1;
			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++;
	}
	//cout<<a<<endl;
	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