Submission #649373

# Submission time Handle Problem Language Result Execution time Memory
649373 2022-10-10T06:33:09 Z birisi XOR Sum (info1cup17_xorsum) C++14
7 / 100
1600 ms 4528 KB
#include <bits/stdc++.h>
using namespace std;


int main() {

	int n;
	cin >> n;

	vector <int> v;

	int x;
	for (int i = 0; i < n; i++) {
		cin >> x;
		v.push_back(x);
	}

	int ans = 0;
	for (int i = 0; i < v.size(); i++) {
		for (int j = i; j < v.size(); j++) {
			ans = ans ^ (v[i] + v[j]);
		}
	}

	cout << ans;

}

Compilation message

xorsum.cpp: In function 'int main()':
xorsum.cpp:19:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |  for (int i = 0; i < v.size(); i++) {
      |                  ~~^~~~~~~~~~
xorsum.cpp:20:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 |   for (int j = i; j < v.size(); j++) {
      |                   ~~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 6 ms 212 KB Output is correct
2 Correct 7 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1690 ms 4528 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1690 ms 4528 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 6 ms 212 KB Output is correct
2 Correct 7 ms 212 KB Output is correct
3 Execution timed out 1689 ms 840 KB Time limit exceeded
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 6 ms 212 KB Output is correct
2 Correct 7 ms 212 KB Output is correct
3 Execution timed out 1690 ms 4528 KB Time limit exceeded
4 Halted 0 ms 0 KB -