50962023-04-16 21:38:08tomi7Bájital (80 pont)cpp11Wrong answer 0/8037ms4800 KiB
// Source: https://usaco.guide/general/io

#include <bits/stdc++.h>
using namespace std;

long long lko(unsigned long long n, unsigned long long m){
	if(n%m==0 || m%n==0){
		return min(n, m);
	}
	if(n>m){
		return lko(n%m, m);
	}else{
		return lko(m%n, n);
	}
}

int main() {
	int n;
	int x;
	cin>>n>>x;
	vector<int> a(n);
	int valasz=0;
	for(int i=0;i<n;i++){
		cin>>a[i];
		if(a[i]=x){
			valasz++;
		}
	}
	cout<<valasz*(n-valasz)+(valasz-1)*valasz<<'\n';
}
SubtaskSumTestVerdictTimeMemory
base0/80
1Wrong answer0/03ms1680 KiB
2Wrong answer0/03ms1844 KiB
3Wrong answer0/23ms2060 KiB
4Wrong answer0/23ms2268 KiB
5Wrong answer0/23ms2488 KiB
6Wrong answer0/23ms2700 KiB
7Wrong answer0/43ms2820 KiB
8Wrong answer0/43ms2892 KiB
9Wrong answer0/237ms3596 KiB
10Wrong answer0/237ms3488 KiB
11Wrong answer0/237ms3612 KiB
12Wrong answer0/237ms3824 KiB
13Wrong answer0/237ms3908 KiB
14Wrong answer0/237ms4040 KiB
15Wrong answer0/237ms4120 KiB
16Wrong answer0/237ms4124 KiB
17Wrong answer0/237ms4272 KiB
18Wrong answer0/237ms4192 KiB
19Wrong answer0/237ms4288 KiB
20Wrong answer0/237ms4564 KiB
21Wrong answer0/237ms4448 KiB
22Wrong answer0/237ms4568 KiB
23Wrong answer0/43ms3720 KiB
24Wrong answer0/42ms3812 KiB
25Wrong answer0/43ms3708 KiB
26Wrong answer0/423ms4420 KiB
27Wrong answer0/437ms4420 KiB
28Wrong answer0/437ms4420 KiB
29Wrong answer0/437ms4420 KiB
30Wrong answer0/237ms4512 KiB
31Wrong answer0/237ms4512 KiB
32Wrong answer0/237ms4740 KiB
33Wrong answer0/237ms4800 KiB