結果

問題 No.184 たのしい排他的論理和(HARD)
ユーザー fgwiebfaoishfgwiebfaoish
提出日時 2020-06-09 00:22:31
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 189 ms / 5,000 ms
コード長 2,617 bytes
コンパイル時間 2,248 ms
コンパイル使用メモリ 108,344 KB
実行使用メモリ 40,956 KB
最終ジャッジ日時 2023-09-17 18:16:57
合計ジャッジ時間 8,445 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
18,780 KB
testcase_01 AC 61 ms
20,816 KB
testcase_02 AC 61 ms
20,732 KB
testcase_03 AC 61 ms
20,712 KB
testcase_04 AC 61 ms
22,780 KB
testcase_05 AC 60 ms
20,800 KB
testcase_06 AC 61 ms
22,856 KB
testcase_07 AC 61 ms
22,880 KB
testcase_08 AC 155 ms
38,296 KB
testcase_09 AC 87 ms
21,932 KB
testcase_10 AC 133 ms
28,012 KB
testcase_11 AC 114 ms
26,556 KB
testcase_12 AC 168 ms
37,472 KB
testcase_13 AC 175 ms
40,168 KB
testcase_14 AC 131 ms
27,696 KB
testcase_15 AC 183 ms
38,852 KB
testcase_16 AC 166 ms
37,036 KB
testcase_17 AC 173 ms
39,808 KB
testcase_18 AC 62 ms
20,924 KB
testcase_19 AC 61 ms
20,800 KB
testcase_20 AC 104 ms
25,900 KB
testcase_21 AC 189 ms
40,956 KB
testcase_22 AC 188 ms
40,900 KB
testcase_23 AC 63 ms
18,748 KB
testcase_24 AC 63 ms
20,764 KB
testcase_25 AC 61 ms
22,756 KB
testcase_26 AC 62 ms
20,664 KB
testcase_27 AC 61 ms
20,788 KB
testcase_28 AC 138 ms
30,664 KB
testcase_29 AC 170 ms
35,708 KB
testcase_30 AC 159 ms
38,676 KB
testcase_31 AC 147 ms
35,260 KB
testcase_32 AC 164 ms
37,196 KB
testcase_33 AC 183 ms
38,648 KB
testcase_34 AC 183 ms
36,724 KB
testcase_35 AC 187 ms
40,896 KB
testcase_36 AC 187 ms
36,628 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.Generic;
using System.Collections;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.IO;
using System.Reflection;
using static System.Math;
using System.Numerics;
using System.Runtime.Serialization.Formatters;
//using nint=System.Int32;
static class Program{
	const int mod=(int)1e9+7;
	const double eps=1e-11;
	static void Main(){
		Sc sc=new Sc();
		var n=sc.I;
		var a=sc.La;
		Gj(a);
		long ans=1;
		for(int i = 0;i<n&&a[i]!=0;i++) {
			ans<<=1;
		}
		Console.WriteLine("{0}",ans);
	}
	static void Gj(long[] b){
		for(int i = 61,k=0;i>=0;i--) {
			int p=-1;
			for(int j = k;j<b.Length;j++) {
				if((b[j]&(1L<<i))!=0){p=j;break;}
			}
			if(p==-1){continue;}
			for(int j = 0;j<b.Length;j++) {
				if((b[j]&(1L<<i))!=0&&j!=p){b[j]^=b[p];}
			}
			if(p!=k){b[p]^=b[k];b[k]^=b[p];b[p]^=b[k];}
			k++;
		}
	}
}

public class Sc{
	public int I{get{return int.Parse(Console.ReadLine());}}
	public long L{get{return long.Parse(Console.ReadLine());}}
	public double D{get{return double.Parse(Console.ReadLine());}}
	public string S{get{return Console.ReadLine();}}
	public int[] Ia{get{return Array.ConvertAll(Console.ReadLine().Split(),int.Parse);}}
	public long[] La{get{return Array.ConvertAll(Console.ReadLine().Split(),long.Parse);}}
	public double[] Da{get{return Array.ConvertAll(Console.ReadLine().Split(),double.Parse);}}
	public string[] Sa{get{return Console.ReadLine().Split();}}
	public object[] Oa{get{return Console.ReadLine().Split();}}
	public int[] Ia2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),int.Parse);}}
	public int[] Ia3(string a,string b){return Array.ConvertAll((a+Console.ReadLine()+b).Split(),int.Parse);}
	public long[] La2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),long.Parse);}}
	public long[] La3(string a,string b){return Array.ConvertAll((a+Console.ReadLine()+b).Split(),long.Parse);}
	public double[] Da2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),double.Parse);}}
	public double[] Da3(string a,string b){return Array.ConvertAll((a+Console.ReadLine()+b).Split(),double.Parse);}
	public T[] Arr<T>(int n,Func<T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f();}return a;}
	public T[] Arr<T>(int n,Func<int,T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(i);}return a;}
	public T[] Arr<T>(int n,Func<string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(Console.ReadLine().Split());}return a;}
	public T[] Arr<T>(int n,Func<int,string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(i,Console.ReadLine().Split());}return a;}
}
0