This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
#include <bits/stdc++.h>
using namespace std;
int main() {
//录入数据到vector数组
int n;
cin >> n;
vector<int> vec;
for (int i = 0; i < n; i++) {
int c;
cin >> c;
vec.push_back(c);
}
//从第1个开始,每一个向它前端找一样的数字,然后加1就是本次出现的次数
int count = 0;
for (int j = i; j >= 0; j--) {
if (vec[i] == vec[j])count++;
cout << count << " ";
return 0;