每次观察判断所观察的牛是否跟上一次观察的位置相同
#include<bits/stdc++.h>
using namespace std;
int n, a[12], t, x, ans;
int main() {
memset(a, 0, sizeof a);
cin >> n;
for (int i = 1; i <= n; i ++ ) {
cin >> x >> t;
if (a[x] && (a[x] - (t * 2 - 1))) ans ++;
a[x] = t * 2 - 1;
}
cout << ans;
}
来啦来啦 ,很水对吧哈哈哈
e