結果

問題 No.2052 Indegree
ユーザー hellopra
提出日時 2022-09-03 19:04:33
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 263 bytes
コンパイル時間 181 ms
コンパイル使用メモリ 81,868 KB
実行使用メモリ 54,016 KB
最終ジャッジ日時 2024-11-17 09:59:46
合計ジャッジ時間 2,297 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 2 WA * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
N,M = map(int,input().split())
D = defaultdict(list)

for i in range(M):
    a,b = map(int,input().split())
    D[a] = []
    D[b].append(a)
 
ans = 0   
for v in D.values():
    if v == []:
        ans += 1
        
print(ans)
0