https://i2.wp.com/eblogarithm.com/wp-content/uploads/2016/12/Codeforces-Round-383-Div-2-problem-B-Arpas-obvious-problem-and-Mehrdads-terrible-solution--Solution-in-CC1.png?fit=640%2C360

Codeforces Round #383 (Div. 2), problem: (B) Arpa’s obvious problem and Mehrdad’s terrible solution , Solution in C/C++

#include<stdio.h>
int v[1500010];
int main(){
	int i,l,n,x;
	long long int r;
	scanf("%d%d",&n,&x);
	for(i=0;i<n;i++)
	{
		scanf("%d",&l);
		r=r+v[l^x];
		v[l]++;
	}
	printf("%I64d",r);
	return 0;
}
(Visited 71 times, 1 visits today)



There are no comments

Add yours

Leave a Reply

%d bloggers like this: