結果

問題 No.2052 Indegree
ユーザー ch1channn
提出日時 2022-12-16 13:19:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 41 ms / 2,000 ms
コード長 409 bytes
コンパイル時間 195 ms
コンパイル使用メモリ 81,972 KB
実行使用メモリ 52,736 KB
最終ジャッジ日時 2024-11-15 18:51:01
合計ジャッジ時間 2,073 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
if sys.platform =='ios':
	import clipboard
	a=clipboard.get()
	a = a.split('\n')
	text = '\n'.join(a)
	with open('input_file.txt','w') as f:
		f.write(text)
	sys.stdin = open('input_file.txt')
	
n,m = map(int,input().split())

G = [[]for i in range(n)]

for i in range(m):
	A,B = map(int,input().split())
	A,B = A-1,B-1
	G[B].append(A)
cnt = 0	
for i in G:
	if len(i) == 0:
		cnt += 1
		
print(cnt)
0