Submission #62073563


Source Code Expand

#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define dou double

using namespace std;
int n;
ll a[15],as[1919810],p=0;
void dfs(ll a[],int len){
	ll b[15];
	ll q=a[1];
	for(int i=2;i<=len;i++){
		q ^=a[i];
	}
	as[++p]=q;
	for(int i=1;i<=len;i++){
		for(int j=i+1;j<=len;j++){
			a[j]+=a[i];
			for(int k=1;k<i;k++) b[k]=a[k];
			for(int k=i+1;k<=len;k++) b[k-1]=a[k];
			dfs(b,len-1);
			
			a[j]-=a[i];
		}
	}
}
int main(){
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>a[i];
	}
	dfs(a,n);
	sort(as+1,as+1+p);
	ll w=0;
	as[0]=-114514;
	for(int i=1;i<=p;i++){
		if(as[i]!=as[i-1]) ++w; 
	}
	cout<<w;
	return 0;
}

Submission Info

Submission Time
Task D - Stone XOR
User 114Laoda514
Language C++ 23 (Clang 16.0.6)
Score 0
Code Size 677 Byte
Status RE
Exec Time 3311 ms
Memory 18380 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 400
Status
AC × 3
AC × 11
TLE × 1
RE × 27
Set Name Test Cases
Sample example_00.txt, example_01.txt, example_02.txt
All example_00.txt, example_01.txt, example_02.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, random_20.txt, random_21.txt, random_22.txt, random_23.txt, random_24.txt, random_25.txt, random_26.txt, random_27.txt, random_28.txt, random_29.txt
Case Name Status Exec Time Memory
example_00.txt AC 1 ms 3464 KiB
example_01.txt AC 1 ms 3548 KiB
example_02.txt AC 1 ms 3516 KiB
hand_00.txt RE 100 ms 18328 KiB
hand_01.txt RE 102 ms 18320 KiB
hand_02.txt TLE 3311 ms 18280 KiB
hand_03.txt RE 103 ms 18328 KiB
hand_04.txt AC 1 ms 3468 KiB
hand_05.txt RE 102 ms 18324 KiB
random_00.txt RE 103 ms 18276 KiB
random_01.txt AC 1 ms 3532 KiB
random_02.txt AC 1 ms 3536 KiB
random_03.txt RE 103 ms 18368 KiB
random_04.txt RE 103 ms 18280 KiB
random_05.txt RE 100 ms 18308 KiB
random_06.txt RE 100 ms 18092 KiB
random_07.txt AC 1 ms 3484 KiB
random_08.txt RE 100 ms 18316 KiB
random_09.txt RE 102 ms 18204 KiB
random_10.txt RE 101 ms 18380 KiB
random_11.txt RE 101 ms 18268 KiB
random_12.txt RE 101 ms 18284 KiB
random_13.txt RE 98 ms 18304 KiB
random_14.txt RE 100 ms 18256 KiB
random_15.txt RE 102 ms 18208 KiB
random_16.txt RE 101 ms 18228 KiB
random_17.txt RE 100 ms 18284 KiB
random_18.txt RE 102 ms 18196 KiB
random_19.txt AC 1 ms 3544 KiB
random_20.txt AC 1 ms 3580 KiB
random_21.txt RE 105 ms 18332 KiB
random_22.txt RE 101 ms 18272 KiB
random_23.txt AC 1 ms 3392 KiB
random_24.txt RE 102 ms 18336 KiB
random_25.txt RE 102 ms 18376 KiB
random_26.txt AC 5 ms 4560 KiB
random_27.txt RE 101 ms 18320 KiB
random_28.txt RE 102 ms 18324 KiB
random_29.txt RE 103 ms 18228 KiB