Submission #959467

# Submission time Handle Problem Language Result Execution time Memory
959467 2024-04-08T09:03:14 Z ramalzaher XOR Sum (info1cup17_xorsum) C++14
7 / 100
1600 ms 8148 KB
#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
//typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update > ordered_set ;
#define int long long
#define F first
#define S second
#define rep(i , j , n ) for(int i = j ;i < n; i++ )
#define FOR(i , n ) rep(i ,0 , n )
#define sz size()
#define pb push_back
#define all(x) x.begin() , x.end()
#define vi vector<int>
#define yes cout<<"YES\n";
#define no cout<<"NO\n";
#define cans cout<<ans<<endl;
#define forx(i, x) for(auto &i : x)
#define fast
#define pii pair<int ,int >
#define endl "\n"
#define sp ' '
const int N = 300 ;
const int inf = 1e15 ;

main()
{
int n ; cin >> n ; int ans = 0 , a[n];forx(it , a )cin >> it ;
FOR(i, n ) {
rep(j ,i , n ) {
ans ^= (a[i]+a[j]) ;
}
}
cout<<ans;
}

Compilation message

xorsum.cpp:25:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   25 | main()
      | ^~~~
# Verdict Execution time Memory Grader output
1 Correct 5 ms 344 KB Output is correct
2 Correct 8 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1679 ms 8148 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1679 ms 8148 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 344 KB Output is correct
2 Correct 8 ms 348 KB Output is correct
3 Execution timed out 1613 ms 2140 KB Time limit exceeded
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 344 KB Output is correct
2 Correct 8 ms 348 KB Output is correct
3 Execution timed out 1679 ms 8148 KB Time limit exceeded
4 Halted 0 ms 0 KB -