結果

問題 No.2052 Indegree
ユーザー gr1msl3y
提出日時 2022-08-24 22:34:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 41 ms / 2,000 ms
コード長 178 bytes
コンパイル時間 220 ms
コンパイル使用メモリ 82,516 KB
実行使用メモリ 52,736 KB
最終ジャッジ日時 2024-10-12 06:34:58
合計ジャッジ時間 1,940 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M=map(int,input().split())
ct=[0]*(N+1)
for _ in range(M):
    a,b=map(int,input().split())
    ct[b]+=1
ans=-1
for i in range(N+1):
    if ct[i]==0:
        ans+=1
print(ans)
0