门禁系统
题目描述
源代码
#include<iostream>
#include<cstring>
using namespace std;
const int N = 1000;
int a[N + 1];
int b[N + 1];
int main()
{
int n;
cin >> n;
memset(b, 0, sizeof(b));
for (int i = 0; i < n; i++)
{
scanf("%d", &a[i]);
b[a[i]]++;
if (i != n)
printf("%d ", b[a[i]]);
else printf("%d\n", b[a[i]]);
}
return 0;
}