結果
| 問題 | No.679 不思議マーケット |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-03-12 01:57:08 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 100 ms / 2,000 ms |
| + 63µs | |
| コード長 | 444 bytes |
| 記録 | |
| コンパイル時間 | 723 ms |
| コンパイル使用メモリ | 95,728 KB |
| 実行使用メモリ | 84,352 KB |
| 最終ジャッジ日時 | 2026-08-28 13:30:24 |
| 合計ジャッジ時間 | 3,733 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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))