Submission #269865

# Submission time Handle Problem Language Result Execution time Memory
269865 2020-08-17T10:53:03 Z AKaan37 XOR Sum (info1cup17_xorsum) C++17
7 / 100
156 ms 4344 KB
//Bismillahirrahmanirrahim
//█▀█─█──█──█▀█─█─█
//█▄█─█──█──█▄█─█▄█
//█─█─█▄─█▄─█─█─█─█

#include <bits/stdc++.h>

using namespace std;

typedef long long lo;
typedef pair< lo,lo > PII;

#define fi first
#define se second
#define mp make_pair
#define endl "\n"
#define pb push_back
#define fio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define FOR for(int i=1;i<=n;i++)
#define mid ((start+end)/2)
#define ort ((bas+son)/2)

const lo inf = 1000000000000000000;
const lo KOK = 100000;
const lo LOG = 30;
const lo li = 500005;
const lo mod = 1000000007;

int n,m,b[li],a[li],k,flag,t,mpp[4005];
int cev;
string s;
vector<int> v;

int main(void){
	scanf("%d",&n);
	FOR{
		scanf("%d",&a[i]);
	}
	if(n<=10000){
		FOR{
			for(int j=i;j<=n;j++){
				cev=cev^(a[j]+a[i]);
			}
		}
	}
	else{
		FOR{
			mpp[a[i]]++;
		}
		for(int i=1;i<=4000;i++){
			if(mpp[i]%2==0)continue;
			for(int j=i;j<=4000;j++){
				if(mpp[j]%2==0)continue;
				cev=cev^(j+i);
			}
		}
	}
	printf("%d\n",cev);
	return 0;
}

Compilation message

xorsum.cpp: In function 'int main()':
xorsum.cpp:35:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   35 |  scanf("%d",&n);
      |  ~~~~~^~~~~~~~~
xorsum.cpp:37:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   37 |   scanf("%d",&a[i]);
      |   ~~~~~^~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 8 ms 384 KB Output is correct
2 Correct 8 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 156 ms 4344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 156 ms 4344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 8 ms 384 KB Output is correct
2 Correct 8 ms 384 KB Output is correct
3 Runtime error 23 ms 1272 KB Execution killed with signal 11
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 8 ms 384 KB Output is correct
2 Correct 8 ms 384 KB Output is correct
3 Incorrect 156 ms 4344 KB Output isn't correct
4 Halted 0 ms 0 KB -