Submission #496773

# Submission time Handle Problem Language Result Execution time Memory
496773 2021-12-22T04:24:40 Z Nalrimet XOR Sum (info1cup17_xorsum) C++17
7 / 100
1600 ms 4124 KB
#include<bits/stdc++.h>

#pragma GCC optimization("g", on)
#pragma GCC optimize ("inline")
#pragma GCC optimization("03")
#pragma GCC optimization("unroll-loops")
//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popused,abm,mmx,avx,tune=native")
using namespace std;

const int N = 1e6 + 5;
const long long inf = 1000000000;
#define ll long long

#define F first
#define S second
#define pb push_back

int n, x[N];
//map<int, bool> used;
//map<int, int> cnt;
//vector<int> v;
long long res;

 main() {

    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    cin >> n;

    for(int i = 1; i <= n; ++i){
        cin >> x[i];
    }

    for(int i = 1; i <= n; ++i){
        for(int j = i; j <= n; ++j){
            res ^= x[i] + x[j];
        }
    }

    cout << res;

}

Compilation message

xorsum.cpp:3: warning: ignoring '#pragma GCC optimization' [-Wunknown-pragmas]
    3 | #pragma GCC optimization("g", on)
      | 
xorsum.cpp:5: warning: ignoring '#pragma GCC optimization' [-Wunknown-pragmas]
    5 | #pragma GCC optimization("03")
      | 
xorsum.cpp:6: warning: ignoring '#pragma GCC optimization' [-Wunknown-pragmas]
    6 | #pragma GCC optimization("unroll-loops")
      | 
xorsum.cpp:26:2: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   26 |  main() {
      |  ^~~~
# Verdict Execution time Memory Grader output
1 Correct 6 ms 332 KB Output is correct
2 Correct 6 ms 332 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1679 ms 4124 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1679 ms 4124 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 6 ms 332 KB Output is correct
2 Correct 6 ms 332 KB Output is correct
3 Execution timed out 1692 ms 588 KB Time limit exceeded
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 6 ms 332 KB Output is correct
2 Correct 6 ms 332 KB Output is correct
3 Execution timed out 1679 ms 4124 KB Time limit exceeded
4 Halted 0 ms 0 KB -