fork download
  1.  
  2. #include<bits/stdc++.h>
  3. using namespace std;
  4. #define ll long long int
  5. int main()
  6. {
  7. ios_base::sync_with_stdio(false);
  8. cin.tie(NULL);
  9. cout.tie(NULL);
  10. ll n,m;
  11. cin>>n>>m;
  12. ll arr[m+1]={0};
  13. for(ll i=0;i<n;i++)
  14. {
  15. ll x;
  16. cin>>x;
  17. arr[x]++;
  18. }
  19. for(ll i=1;i<=m;i++)
  20. {
  21. cout<<arr[i]<<endl;
  22. }
  23. }
Success #stdin #stdout 0.01s 5456KB
stdin
10 5
1 2 3 4 5 3 2 1 5 3
stdout
2
2
3
1
2