Submission #521845

# Submission time Handle Problem Language Result Execution time Memory
521845 2022-02-03T10:01:53 Z iskhakkutbilim XOR Sum (info1cup17_xorsum) C++14
0 / 100
1600 ms 128080 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(){
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr); cout.tie(nullptr);
	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 1682 ms 99800 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1687 ms 128080 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1687 ms 128080 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1682 ms 99800 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1682 ms 99800 KB Time limit exceeded
2 Halted 0 ms 0 KB -