結果
問題 |
No.2052 Indegree
|
ユーザー |
![]() |
提出日時 | 2022-08-21 16:04:52 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 525 bytes |
コンパイル時間 | 413 ms |
コンパイル使用メモリ | 41,028 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-10 06:13:59 |
合計ジャッジ時間 | 1,151 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 20 |
ソースコード
/* -*- coding: utf-8 -*- * * 2052.cc: No.2052 Indegree - yukicoder */ #include<cstdio> #include<algorithm> using namespace std; /* constant */ const int MAX_N = 100; /* typedef */ /* global variables */ int ids[MAX_N]; /* subroutines */ /* main */ int main() { int n, m; scanf("%d%d", &n, &m); for (int i = 0; i < m; i++) { int u, v; scanf("%d%d", &u, &v); u--, v--; ids[v]++; } int c = 0; for (int i = 0; i < n; i++) if (ids[i] == 0) c++; printf("%d\n", c); return 0; }