Submission #649372

# Submission time Handle Problem Language Result Execution time Memory
649372 2022-10-10T06:32:33 Z DangerNoodle7591 XOR Sum (info1cup17_xorsum) C++17
0 / 100
78 ms 4180 KB
#include <iostream>
using namespace std;
int var[10000];
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n;cin>>n;
	int arr[n];
	int sin=n;
	int x=0;
	for(int i=0;i<sin;i++){
		int a;
		cin>>a;
		if(var[a]){
			var[a]=0;
			i=i-2;
			sin=sin-2;
			x=x^(a+a);
			continue;
		}
		arr[i]=a;
		var[arr[i]]=1;
	}
	for(int i=0;i<sin;i++){
		for(int j=i;j<sin;j++){
			x=x^(arr[i]+arr[j]);
		}
	}
	cout<<x<<"\n";
}
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 468 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 78 ms 4180 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 78 ms 4180 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 468 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 468 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -