fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n = 0 , m = 0, i, buf;
  6. cin >> n >> m;
  7. int *a = new int [n];
  8. for(i = 0; i < n; a[i] = 0, ++i)
  9. for(i = 0 , buf; i < 2*m ; cin >> buf, ++a[buf - 1], ++i);
  10. for(i = 0; i < n; ++i){
  11. cout << a[i] << endl;
  12. }
  13. return 0;
  14. }
Success #stdin #stdout 0s 3232KB
stdin
4 4
1 2
1 3
2 3
3 4
stdout
2
2
3
1