답안 #169595

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
169595 2019-12-21T09:36:42 Z Rouge_Hugo XOR Sum (info1cup17_xorsum) C++14
11 / 100
1600 ms 10968 KB
#include <bits/stdc++.h>
#define ll long long
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);

using namespace std;
int a[1000009];
int n,x,xo;
int main()
{
    cin>>n;
    int mx=0;
    for(int i=0;i<n;i++)
    {
        cin>>x;
        a[x]++;
        mx=max(mx,x);
    }
    for(int i=1;i<=mx;i++)
    {
        if (a[i]==0)continue;
        for(int j=1;j<i;j++)
        {
            if (a[j]==0)continue;
            if ((a[i]*a[j])%2==0)continue;
            xo^=(i+j);
        }
        ll y=a[i]+1;
        y*=a[i];
        y/=2;
        if(y%2)xo^=i*2;
    }
    cout<<xo;
}
# 결과 실행 시간 메모리 Grader output
1 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 432 ms 5108 KB Output is correct
2 Correct 405 ms 4760 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 432 ms 5108 KB Output is correct
2 Correct 405 ms 4760 KB Output is correct
3 Execution timed out 1661 ms 10968 KB Time limit exceeded
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -