Submission #522864

# Submission time Handle Problem Language Result Execution time Memory
522864 2022-02-06T07:17:29 Z n3rm1n XOR Sum (info1cup17_xorsum) C++17
7 / 100
10 ms 716 KB
#include<bits/stdc++.h>
#define endl '\n'

using namespace std;
const int MAXN = 4 * 1e3 + 10;
void speed()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
}
int n, a[MAXN];
int ans;
void read()
{
    cin >> n;
    cin >> a[1];
    ans = a[1]*2;
    for (int i = 2; i <= n; ++ i)
    {
        cin >> a[i];
        ans = (ans ^ (a[i]*2));
    }
}
void solve_N2()
{
    for (int i = 1; i <= n; ++ i)
    {
        for (int j = i+1; j <= n; ++ j)
        {
            ans = (ans ^ (a[i]+a[j]));
        }
    }
    cout << ans << endl;
}
int main()
{
	speed();
	read();
	solve_N2();
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 10 ms 452 KB Output is correct
2 Correct 7 ms 328 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 332 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 332 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 10 ms 452 KB Output is correct
2 Correct 7 ms 328 KB Output is correct
3 Runtime error 1 ms 716 KB Execution killed with signal 11
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 10 ms 452 KB Output is correct
2 Correct 7 ms 328 KB Output is correct
3 Incorrect 1 ms 332 KB Output isn't correct
4 Halted 0 ms 0 KB -