結果

問題 No.2052 Indegree
ユーザー elphe
提出日時 2024-06-27 15:55:51
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 27 ms / 2,000 ms
コード長 396 bytes
コンパイル時間 647 ms
コンパイル使用メモリ 71,268 KB
最終ジャッジ日時 2025-02-22 00:46:56
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>

using namespace std;

int main()
{
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    int N, M, A, B, i, ans = 0;
    cin >> N >> M;
    vector<int> count(N, 0);

    for (i = 0; i != M; ++i)
        cin >> A >> B, ++count[B - 1];

    for (i = 0; i != N; ++i)
        if (count[i] == 0)
            ++ans;

    cout << ans << '\n';
    return 0;
}
0