結果

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

ソースコード

diff #

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

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