AcWing 4454. 未初始化警告
原题链接
简单
作者:
改了吧
,
2023-01-09 21:42:25
,
所有人可见
,
阅读 101
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
const int N = 1e5 + 10;
const int R = (1 << 20) + 10;
const int Base = N / 2;
const int M = 2 * N;
const int P = 998244353;
typedef pair<int, int> PII;
typedef long long LL;
int n, m, k;
const LL mod = 1e8 - 3;
int a[N];
int b[N];
int c[N];
int tr[N];
void solve()
{
scanf("%d %d", &n, &k);
int ans = 0;
unordered_map<int, bool> mp;
while (k--)
{
int x, y;
scanf("%d %d", &x, &y);
if (!mp.count(y) && y)
{
ans++;
}
mp[x] = true;
}
cout << ans;
}
int main()
{
int t;
t = 1;
// scanf("%d", &t);
while (t--)
{
solve();
}
return 0;
}