Submission #932071

# Submission time Handle Problem Language Result Execution time Memory
932071 2024-02-22T21:50:52 Z Sputnik123 XOR Sum (info1cup17_xorsum) C++14
45 / 100
1600 ms 8284 KB
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <string.h>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <functional>
#include <cstdio>
#define pb push_back
#define in insert
#define pll pair<ll,ll>
#define vpl vector<pll>
#define vll vector <ll>
#define vl vector<ll>
///#define mp make_pair
#define F first
#define S second
#define all(v) v.begin(),v.end()
#define endl "\n"
#define ll long long 
#define ull unsigned long long
using namespace std;
using namespace __gnu_pbds;
#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt,fma")
const ll sz=2e5+5;
const ll inf=1e12+7;
const ll mod=998244353;
const ll P=47;
///const double e=1e-6;
ll gcd(ll x,ll y)
{
    return (y ? gcd(y,x%y) : x);
}
ll lcm(ll x,ll y)
{
    return (x/gcd(x,y))*y;
}
ll binpow(ll a,ll b)
{
    ll ans=1;
    a%=mod;
    while(b)
    {
        ans=(b&1 ? (ans*a)%mod : ans);
        a=(a*a)%mod;
        b>>=1;
    }
    return ans;
}
ll modm(ll n,ll m,ll md=mod)
{
    if(!m)  return 1;
    ll res=modm(n,m>>1,md);
    if(m&1) return res*res%md*n%md;
    return res*res%md;
}
bool isprime(ll n){
    if(n<3)    return false;
    for(ll i=2;i<=sqrt(n);i++){
        if(n%i==0)  return  false;
    }
    return true;
}
void solve()
{
    ll n;
    cin>>n;
    vll a(n);
    for(ll i=0;i<n;i++) cin>>a[i];
    ll ans=0;
    for(ll i=0;i<n;i++)
    {
        for(ll j=0;j<=i;j++)
        {
            ans^=(a[j]+a[i]);
        }
    }
    cout<<ans<<endl;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll t=1;
    //cin>>t;
    while(t--)
    {
        solve();
    }
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1633 ms 8284 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1633 ms 8284 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 550 ms 1112 KB Output is correct
4 Correct 544 ms 2140 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Execution timed out 1633 ms 8284 KB Time limit exceeded
4 Halted 0 ms 0 KB -