結果
問題 |
No.679 不思議マーケット
|
ユーザー |
|
提出日時 | 2022-03-12 01:57:08 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 101 ms / 2,000 ms |
コード長 | 444 bytes |
コンパイル時間 | 238 ms |
コンパイル使用メモリ | 82,152 KB |
実行使用メモリ | 76,196 KB |
最終ジャッジ日時 | 2024-09-16 06:03:20 |
合計ジャッジ時間 | 2,250 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 18 |
ソースコード
N,M = map(int,input().split()) ls = [1]*(N) dic = dict() for i in range(M): a,b = map(int, input().split()) l = list(map(lambda x :int(x)-1, input().split())) a -= 1 ls[a] = 0 dic[a] = l for _ in range(N): for i in dic.keys(): f = True for j in dic[i]: if ls[j] == 0: f = False break if f: ls[i] = 1 continue print(ls.count(1))