Submission #521834

# Submission time Handle Problem Language Result Execution time Memory
521834 2022-02-03T09:27:03 Z iskhakkutbilim XOR Sum (info1cup17_xorsum) C++14
0 / 100
1600 ms 96880 KB
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ff first
#define ss second
const int INF = 1e9 + 7;
const int N = 1e5 + 1;


void solve(){
	
}

main(){
	int n; cin >> n;
	vector<int> a(n);
	multiset<int> st;
	for(int i = 0;i < n; i++){
		cin >> a[i];
	}
	for(int i = 0;i < n; i++){
		for(int j = i;j < n; j++){
			st.insert(a[i] + a[j]);
			// cout << a[i] + a[j] << "\n";
		}
	}
	int xr = 0;
	for(auto x : st){
	
		xr^= x;
	}
	// cout << "\n" << "------" << "\n";
	cout << xr;
	return 0;
}

Compilation message

xorsum.cpp:14:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   14 | main(){
      | ^~~~
# Verdict Execution time Memory Grader output
1 Execution timed out 1670 ms 94416 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1683 ms 96880 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1683 ms 96880 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1670 ms 94416 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1670 ms 94416 KB Time limit exceeded
2 Halted 0 ms 0 KB -