50972023-04-16 21:40:31tomi7Bájital (80 pont)cpp11Wrong answer 4/8037ms5252 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
base4/80
1Accepted0/03ms1852 KiB
2Wrong answer0/03ms2236 KiB
3Wrong answer0/23ms2304 KiB
4Wrong answer0/23ms2512 KiB
5Wrong answer0/23ms2524 KiB
6Wrong answer0/23ms2784 KiB
7Wrong answer0/43ms2840 KiB
8Wrong answer0/43ms2920 KiB
9Wrong answer0/237ms3720 KiB
10Wrong answer0/237ms3812 KiB
11Wrong answer0/237ms3972 KiB
12Wrong answer0/237ms4060 KiB
13Wrong answer0/237ms4060 KiB
14Wrong answer0/237ms4156 KiB
15Wrong answer0/237ms4060 KiB
16Wrong answer0/237ms4172 KiB
17Wrong answer0/237ms4384 KiB
18Wrong answer0/237ms4480 KiB
19Wrong answer0/237ms4580 KiB
20Wrong answer0/237ms4568 KiB
21Wrong answer0/237ms4696 KiB
22Wrong answer0/237ms4912 KiB
23Wrong answer0/42ms4368 KiB
24Wrong answer0/42ms4276 KiB
25Wrong answer0/42ms4208 KiB
26Accepted4/423ms4908 KiB
27Wrong answer0/437ms4912 KiB
28Wrong answer0/437ms4912 KiB
29Wrong answer0/437ms4912 KiB
30Wrong answer0/237ms5040 KiB
31Wrong answer0/237ms5252 KiB
32Wrong answer0/237ms5248 KiB
33Wrong answer0/237ms5248 KiB