結果

問題 No.184 たのしい排他的論理和(HARD)
ユーザー kuuso1kuuso1
提出日時 2015-04-17 00:00:32
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 1,425 ms / 5,000 ms
コード長 1,197 bytes
コンパイル時間 3,423 ms
コンパイル使用メモリ 106,648 KB
実行使用メモリ 41,368 KB
最終ジャッジ日時 2023-09-17 16:24:48
合計ジャッジ時間 28,817 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
20,768 KB
testcase_01 AC 60 ms
20,672 KB
testcase_02 AC 61 ms
20,728 KB
testcase_03 AC 61 ms
20,684 KB
testcase_04 AC 61 ms
20,680 KB
testcase_05 AC 62 ms
20,772 KB
testcase_06 AC 62 ms
22,820 KB
testcase_07 AC 63 ms
20,752 KB
testcase_08 AC 982 ms
38,284 KB
testcase_09 AC 225 ms
21,916 KB
testcase_10 AC 715 ms
28,016 KB
testcase_11 AC 521 ms
26,620 KB
testcase_12 AC 1,135 ms
41,368 KB
testcase_13 AC 1,262 ms
37,932 KB
testcase_14 AC 699 ms
27,652 KB
testcase_15 AC 1,379 ms
40,512 KB
testcase_16 AC 1,122 ms
37,108 KB
testcase_17 AC 1,203 ms
37,596 KB
testcase_18 AC 62 ms
22,700 KB
testcase_19 AC 60 ms
20,800 KB
testcase_20 AC 110 ms
27,956 KB
testcase_21 AC 1,425 ms
38,816 KB
testcase_22 AC 1,419 ms
40,852 KB
testcase_23 AC 62 ms
22,768 KB
testcase_24 AC 62 ms
20,672 KB
testcase_25 AC 62 ms
22,808 KB
testcase_26 AC 62 ms
22,736 KB
testcase_27 AC 62 ms
18,768 KB
testcase_28 AC 805 ms
30,496 KB
testcase_29 AC 1,171 ms
39,680 KB
testcase_30 AC 993 ms
38,724 KB
testcase_31 AC 845 ms
37,252 KB
testcase_32 AC 1,071 ms
37,104 KB
testcase_33 AC 1,400 ms
40,660 KB
testcase_34 AC 1,335 ms
40,552 KB
testcase_35 AC 1,402 ms
38,788 KB
testcase_36 AC 1,393 ms
36,644 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections;
using System.Collections.Generic;
 
class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		Array.Sort(A,(x,y)=>x>y?-1:x<y?1:0);
		for(int i=0;i<N;i++){
			if(A[i]==0)continue;
			int bit=0;
			for(int j=0;j<62;j++){
				if(((A[i]>>j)&1)>0)bit=j;
			}

			for(int j=i+1;j<N;j++){
				if(((A[j]>>bit)&1)>0)A[j]^=A[i];
			}
			Array.Sort(A,(x,y)=>x>y?-1:x<y?1:0);
		}
		int cnt=0;
		for(int i=0;i<N;i++){
			if(A[i]!=0)cnt++;
		}
		Console.WriteLine(1L<<cnt);
	}
	int N;
	long[] A;
	public Sol(){
		N=ri();
		A=rla();
	}




	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(){return Console.ReadLine().Split(' ');}
	static int[] ria(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>int.Parse(e));}
	static long[] rla(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>long.Parse(e));}
	static double[] rda(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>double.Parse(e));}
}
0