AcWing 4454. 未初始化警告
原题链接
简单
作者:
Coinisi.
,
2023-01-10 08:43:06
,
所有人可见
,
阅读 171
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cmath>
#include <cstring>
#include <unordered_map>
#include <unordered_set>
#define IOS std::ios::sync_with_stdio(false)
#define inf 0x3f3f3f3f
#define YES cout << "YES" << endl
#define yes cout << "yes" << endl
#define no cout << "no" << endl
#define NO cout << "NO" << endl
#define int long long
#define x first
#define y second
//#define cmp [&](PII a, PII b){ return a.y < b.y; }
const int N = 5e5+10, mod = 1e9+7, M = 1e6+5, K = 1e5+10, Z = 2e5+7;
using namespace std;
typedef long long LL;
typedef priority_queue<int> PQI;
typedef priority_queue <int, vector<int>, greater<>> PQGI;
typedef pair<int, int> PII;
int a[K], res;
void solve()
{
int n, m; cin >> n >> m;
for(int i = 1; i <= m; i ++)
{
int x, y; cin >> x >> y;
if(!a[y] && y != 0) res ++;
a[x] ++;
}
cout << res << endl;
}
signed main()
{
IOS; int T = 1;
// cin >> T;
while( T -- ) solve();
return 0;
}