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. ll arr[m+1]={0};
  12. for(ll i=0;i<n;i++)
  13. {
  14. ll x;
  15. cin>>x;
  16. arr[x]++;
  17. }
  18. for(auto &x:arr)
  19. {
  20. if(x!=0)
  21. {
  22. cout<<x<<"\n";
  23. }
  24. }
  25. }
Success #stdin #stdout 0.01s 5296KB
stdin
10 5
1 2 3 4 5 3 2 1 5 3
stdout
Standard output is empty