#include <bits/stdc++.h>
using namespace std;
signed main()
{
int n, k, cnt = 0;
cin >> n >> k;
set <int> se;
se.insert(0);
while (k --)
{
int x, y;
cin >> x >> y;
if (!se.count(y)) cnt ++;
se.insert(x);
}
cout << cnt << '\n';
return 0;
}
标签:初始化,cnt,insert,int,cin,警告,se,AcWing
From: https://www.cnblogs.com/BaiduFirstSearch/p/acwingday1.html