fork download
  1. #include<stdio.h>
  2. int Q[12];
  3. int main() {
  4. int n, ans = 0;
  5. scanf("%d", &n);
  6. for (int i = 0; i < n; i++) {
  7. int x, y;
  8. scanf("%d%d", &x, &y);
  9. y++;
  10. if (Q[x] == 0)Q[x] = y;
  11. else if (Q[x] != y)Q[x] = y, ans++;
  12. }
  13. printf("%d", ans);
  14. return 0;
  15. }
Success #stdin #stdout 0s 4192KB
stdin
8
3 1
3 0
6 0
2 1
4 1
3 0
4 0
3 1
stdout
3