ZhenlongDai/ACPR huggingface dataset:
Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N, K = map(int, input().split())
List = []
void = 0
cnt = 0
for i in range(int(K)):
    void = int(input())
    List.append(list(map(int, input().split())))

arr = [int(x) for y in List for x in y]

for k in range(1,N):
    if k in arr:
        pass
    else:
        cnt += 1

print(cnt)


Failing test case input:
12 -2
0
0 0
0
-1

Expected output:
12


Actual output:
11


Fixed submission (verdict: Accepted):
N, K = map(int, input().split())
List = []
void = 0
cnt = 0
for i in range(int(K)):
    void = int(input())
    List.append(list(map(int, input().split())))

arr = [int(x) for y in List for x in y]

for k in range(1,N+1):
    if k in arr:
        pass
    else:
        cnt += 1

print(cnt)

Problem: p02688
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N, K = map(int, input().split())
d = [0] * K
y = [0] * N
for i in range(K):
    d[i]=int(input())
    A= list(map(int, input().split()))
    for x in A:
        y[x-1]+=1
for ans in y:
    if ans==0:
        print(y.index(ans)+1)

Failing test case input:
3 -2
1
0 0
0
-1

Expected output:
3


Actual output:
1
1
1


Fixed submission (verdict: Accepted):
N, K = map(int, input().split())
d = [0] * K
y = [0] * N
for i in range(K):
    d[i]=int(input())
    A= list(map(int, input().split()))
    for x in A:
        y[x-1]+=1
a=0
for ans in y:
    if ans==0:
          a+=1
print(a)

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):

n,k =map(int,input().split())
a = []

for i in range(k):
    d = int(input())
    e = map(int,input().split())
    a.append(e)
    
print(int(n-len(set(a))))

Failing test case input:
5 1
2
1 4
2
1

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
n,k = map(int,input().split())
a = []

for i in range(k):
    d = int(input())
    e = list(map(int,input().split()))
    a += e
    
a_new = [int(s) for s in a]

print(int(n-len(set(a))))

Problem: p02688
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N,K = list(map(int,input().split()))
d = []
A = []
for i in range(K):
    d.append(int(input()))
    A.extend(list(map(int,input().split())))

A.sort()
A = set(A)
count = 0
for i in range(1,K+1):
    if i in A:
        pass
    else:
        count += 1
print(count)

Failing test case input:
1 -8
-1
0 -1
2
-2

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
N,K = list(map(int,input().split()))
d = []
A = []
for i in range(K):
    d.append(int(input()))
    A.extend(list(map(int,input().split())))

A.sort()
A = set(A)
count = 0
for i in range(1,N+1):
    if i in A:
        pass
    else:
        count += 1
print(count)
Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N,K = map(int, input().split())
A = []
for i in range(K) :
    d = int(input())
    A.append(input().split(" "))
    
snukeList = []
for i in range(len(A)) :
    for j in range(len(A[i])) :
        snukeList.append(int(A[i][j]))
count = 0
uniqueSnuke = list(set(snukeList))
for i in range(1, N) :
    if i in uniqueSnuke :
        continue
    count += 1
print(count)


Failing test case input:
1 -4
-2
0 -1
2
-2

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
N,K = map(int, input().split())
A = []
for i in range(K) :
    d = int(input())
    A.append(input().split(" "))
    
snukeList = []
for i in range(len(A)) :
    for j in range(len(A[i])) :
        snukeList.append(int(A[i][j]))
count = 0
for i in range(1, N+1) :
    if i in snukeList :
        continue
    count += 1
print(count)

Problem: p02688
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N,K = map(int,input().split())

S = [0 for i in range(N)]
for i in range(K):
  d = int(input())
  A = list(map(int,input().split()))
  for j in range(d):
    S[d-1]+=1
ans = 0
for i in range(N):
  if S[i]==0:
    ans+=1

print(ans)

Failing test case input:
5 1
2
1 4
1
3

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
N,K = map(int,input().split())

S = [0 for i in range(N)]

for i in range(K):
  d = int(input())
  A = list(map(int,input().split()))
  for j in range(d):
    S[A[j]-1]+=1
    
ans = 0
for i in range(N):
  if S[i]==0:
    ans+=1
    
print(ans)

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n, k = map(int, input().split())

a = []

s = 0
for i in range(k):
  d = int(input())
  array = list(map(int, input().strip().split()))
  a.append(array)
for j in range(1, k):
  if k not in a:
    s += 1
print(s)  


Failing test case input:
1 -2
-2
-1 -1
2
-2

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
n, k = map(int, input().split())

array = []

s = 0
for i in range(k):
  d = int(input())
  array += list(map(int, input().strip().split()))

array = set(array)

for j in range(1,n+1):
  if j not in array:
    s += 1
print(s)

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n, k = map(int, input().split())

array = []

s = 0
for i in range(k):
  d = int(input())
  array += list(map(int, input().strip().split()))

array = set(array)


for j in range(1,n):
  if j not in array:
    s += 1
print(s)  


Failing test case input:
12 -2
0
-1 0
0
-2

Expected output:
12


Actual output:
11


Fixed submission (verdict: Accepted):
n, k = map(int, input().split())

array = []

s = 0
for i in range(k):
  d = int(input())
  array += list(map(int, input().strip().split()))

array = set(array)

for j in range(1,n+1):
  if j not in array:
    s += 1
print(s)
Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,k=map(int, input().split())
S = []
for i in range(k):
    d1 = int(input())
    S.append([])
    S[i].append(list(map(int, input().split())))

ans = [0]*n

for i,s in enumerate(S):
    for d in s:
        ans[int(d[0])-1]+=1

cnt = 0
for i in ans:
    if i == 0:
        cnt+=1
print(cnt)

Failing test case input:
5 1
2
1 4
2
1

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
n,k=map(int, input().split())
S = []
for i in range(k):
    d1 = int(input())
    
    S.append(list(map(int, input().split())))

ans = [0]*n

for i,s in enumerate(S):
    for d in s:
        ans[int(d)-1]+=1


cnt = 0
for i in ans:
    if i == 0:
        cnt+=1
print(cnt)

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
whatMan = []

N, K = input().split()
for i in range(int(K)):
    whatMan.extend(input().split())
print(int(N) - len(set(whatMan)))

Failing test case input:
5 1
2
1 3
1
3

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
whatMan = []

N, K = input().split()
for i in range(int(K)):
    input()
    whatMan.extend(input().split())
print(int(N) - len(set(whatMan)))

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,k = map(int,input().split())
d = [0]*k
a = [0]*k
s = []
for i in range(k):
    d[i] = int(input())
    a[i] = list(map(int,input().split()))
    s.extend(a[i])
d = set(s)

print(n-len(d))
print(s)

Failing test case input:
1 -8
-1
1 0
2
-2

Expected output:
1


Actual output:
1
[]


Fixed submission (verdict: Accepted):
n,k = map(int,input().split())
d = [0]*k
a = [0]*k
s = []
for i in range(k):
    d[i] = int(input())
    a[i] = list(map(int,input().split()))
    s.extend(a[i])
d = set(s)
print(n-len(d))

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,k=map(int,input().split())
d = int(input())
while True:
    try:
        listA=list(map(int,input().split()))
        
        
    except:
        break;
print(n-d)

Failing test case input:
1 -8
-1
1 0
2
-2

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
n,k=map(int,input().split())
y=[0]*n
for i in range(k):
    d = int(input())
    a=list(map(int, input().split()))
    for j in a:
        y[j-1] += 1

print(y.count(0))
Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
init=input().split()
num=int(init[0])
snacks=int(init[1])
check=[]

for i in range(snacks):
  sNum=int(input())
  if sNum>1:
    whos=input().split()
    for j in range(sNum):
      check.append(whos[j])
  else:
    who=input()
    check.append(who)
   
count=0
for i in range(1,num):
  if str(i) not in check:
    count=count+1
print(count)

Failing test case input:
1 -1
2
1 2
5
-1

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
init=input().split()
num=int(init[0])
snacks=int(init[1])
check=[]
 
for i in range(snacks):
  sNum=int(input())
  if sNum>1:
    whos=input().split()
    for j in range(sNum):
      check.append(whos[j])
  else:
    who=input()
    check.append(who)
   
count=0
for i in range(1,num+1):
  if str(i) not in check:
    count=count+1
print(count)

Problem: p02688
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n,k = [int(ch) for ch in input().split()]
snuckList = []
for i in range(n):
    snuckList.append(i+1)
for i in range(k):
    snuck = int(input())
    snackList = input()
    if snuck in snuckList:
        snuckList.remove(snuck)
print(len(snuckList))

Failing test case input:
3 1
2
1 3
1
3

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
n,k = [int(ch) for ch in input().split()]
snuckList = []
for i in range(n):
    snuckList.append(i+1)
for i in range(k):
    cnt = int(input())
    snucks = [int(ch) for ch in input().split()]
    for snuck in snucks:
        if snuck in snuckList: 
            snuckList.remove(snuck)
print(len(snuckList))

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):


n, k = map(int, input().split())

having_okasi = set()
for _ in range(k):
    d = int(input())
    if d == 1:
        having_okasi.add(int(input()))
    else:
        having_okasi.add(map(int, input().split()))

print(n - len(having_okasi))

Failing test case input:
5 1
2
1 3
1
3

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):


n, k = map(int, input().split())
having_okasi = set()

for _ in range(k):
    d = int(input())
    if d == 1:
        having_okasi.add(input())
    else:
        having_okasi |= (set(input().split()))

print(n - len(having_okasi))
Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N,K=map(int,input().split())
D=[]
A=[]
for i in range(K):
    d=int(input())
    D.append(d)
    Ai=[int(x) for x in input().split()]
    A.append(Ai)
NUMBERS=[int(x) for x in range(1,N+1)]
for i in range(K):
    for j in range(D[i]):
        if A[i][j] in NUMBERS:
            NUMBERS.remove(A[i][j])
for i in range(len(NUMBERS)):
    print(len(NUMBERS))


Failing test case input:
3 3
1
3
1
3
1
3

Expected output:
2

Actual output:
2
2


Fixed submission (verdict: Accepted):
N,K=map(int,input().split())
D=[]
A=[]
for i in range(K):
    d=int(input())
    D.append(d)
    Ai=[int(x) for x in input().split()]
    A.append(Ai)
NUMBERS=[int(x) for x in range(1,N+1)]
for i in range(K):
    for j in range(D[i]):
        if A[i][j] in NUMBERS:
            NUMBERS.remove(A[i][j])
        else:
            pass
print(len(NUMBERS))

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N,K=map(int,input().split())
kashi_num = [str(i+1) for i in range(N)]
for _ in range(K):
  d = input()
  for a in input().split():
    if a in kashi_num:
      kashi_num.remove(a)
  if len(kashi_num)==0:
    break
print(' '.join(kashi_num))

Failing test case input:
12 -2
0
-1 0
1
-2

Expected output:
12


Actual output:
1 2 3 4 5 6 7 8 9 10 11 12


Fixed submission (verdict: Accepted):
N,K=map(int,input().split())
kashi_num = [str(i+1) for i in range(N)]
for _ in range(K):
  d = input()
  for a in input().split():
    if a in kashi_num:
      kashi_num.remove(a)
  if len(kashi_num)==0:
    break
print(len(kashi_num))

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
nk = input().split()
n = int(nk[0])
k = int(nk[1])
s = [input() for i in range(k*2)]
o = []

for  j in range(len(s)):
    if j % 2 == 0:
        pass
    else:
        o[len(o):len(o)] = s[j]

l =list(set(o))
ans = n - len(l) 
print(ans)

Failing test case input:
5 1
2
1 3
1
3

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
nk = input().split()
n = int(nk[0])
k = int(nk[1])
s = [input().split() for i in range(k*2)]
o = []
 
for  j in range(len(s)):
    if j % 2 == 0:
        pass
    else:
        o[len(o):len(o)] = s[j]
 
l =list(set(o))
ans = n - len(l) 
print(ans)
Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n, k = map(int, input().split())
hash_list = [False for i in range(n)]

for i in range(k):
    d = int(input())
    okashi_list = list(map(int,input().split()))
    print(okashi_list)
    for j in range(d):
        having = okashi_list[j] - 1
        if not hash_list[having]:
            hash_list[having] = True

count = 0
for i in range(n):
    if not hash_list[i]:
        count += 1
        

print(hash_list)
print(count)

Failing test case input:
0 -1
-1
-1 -1
1
-1

Expected output:
0


Actual output:
[]
0


Fixed submission (verdict: Accepted):
n, k = map(int, input().split())
hash_list = [False for i in range(n)]

for i in range(k):
    d = int(input())
    okashi_list = list(map(int,input().split()))
    for j in range(d):
        having = okashi_list[j] - 1
        if not hash_list[having]:
            hash_list[having] = True

count = 0
for i in range(n):
    if not hash_list[i]:
        count += 1
        

print(count)

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import collections
N,K=map(int,input().split())
a=[]
while K>0:
  K=K-1
  d=int(input())
  a.append(map(int,input().split()))
e=collections.Counter(a)
print(N-len(e))

Failing test case input:
5 1
2
1 4
1
3

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
import collections
N,K=map(int,input().split())
a=[]
d=[]
while K>0:
  K=K-1
  d.append(int(input()))
  b=list(map(int,input().split()))
  a.extend(b)
e=collections.Counter(a)
print(N-len(e))

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N,K=map(int,input().split())
dlist=[]
Alist=[]
for i in range(K):
    dlist.append(input())
    Alist.append(list(map(int,input().split()))[0])


Alist=list(set(Alist))

print(N-len(Alist))

Failing test case input:
5 1
2
1 4
2
3

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
N,K=map(int,input().split())
dlist=[]
Alist=[]
for i in range(K):
    dlist.append(input())
    Alist.append(list(map(int,input().split())))


import itertools
Alist=list(itertools.chain.from_iterable(Alist))

Alist=list(set(Alist))

print(N-len(Alist))
Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,k = [int(x) for x in input().split(' ')]
 
def solve(n, k):
    snukes = [None] * n
    victims = 0
    
    for i in range(k):
        snacks = int(input())
        snukes_snacks = [int(z) for z in input().split(' ')]
        for j in range(snacks):
            snukes[snukes_snacks[j] - 1] = snukes_snacks[j]
    
    print(snukes)
    for w in range(n):
        if snukes[w] is None:
            victims += 1
    
    print(victims)
 
solve(n, k)

Failing test case input:
1 -2
4
1 1
20
-2

Expected output:
1


Actual output:
[None]
1


Fixed submission (verdict: Accepted):
n,k = [int(x) for x in input().split(' ')]
 
def solve(n, k):
    snukes = [None] * n
    victims = 0
    
    for i in range(k):
        snacks = int(input())
        snukes_snacks = [int(z) for z in input().split(' ')]
        for j in range(snacks):
            snukes[snukes_snacks[j] - 1] = snukes_snacks[j]
    
    for w in range(n):
        if snukes[w] is None:
            victims += 1
    
    print(victims)
 
solve(n, k)

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N,K=map(int,input().split())
a=[list(map(int,input().split()))for i in range(2*K)]
sunuke=[]
for i in range(2*K-1):
    if i%2==1:
        d=sum(a[i-1])
        for n in range(d):
            sunuke.append(a[i][n])
sunuke=set(sunuke)
print(N-len(sunuke))

Failing test case input:
5 1
2
1 4
2
1

Expected output:
3


Actual output:
5


Fixed submission (verdict: Accepted):
N,K=map(int,input().split())
a=[list(map(int,input().split()))for i in range(2*K)]
sunuke=[]
for i in range(2*K):
    if i%2==1:
        d=sum(a[i-1])
        for n in range(d):
            sunuke.append(a[i][n])
sunuke=set(sunuke)
print(N-len(sunuke))

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N, K=map(int,input().split())
d=[]

for i in range(K):
    d.append(int(input()))
    A=input()

print(N - len(set(d)))

Failing test case input:
5 1
2
1 4
2
1

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
N, K=map(int,input().split())
A=set()

for _ in range(K):
    d=input()
    A=A|set(map(int,input().split()))
    
print(N-len(A))

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n, k = map(int, input().split())
lst = []
count = 0
for i in range(k):
    d = int(input())
    a = input().split()
    lst.append(a)
for i in range(k):
    if str(i+1) not in lst[i]:
        count += 1
print(count)



Failing test case input:
2 0
4
0 1
16
-4

Expected output:
2


Actual output:
0


Fixed submission (verdict: Accepted):
n, k = map(int, input().split())
lst = []
tmp = []
count = 0
for i in range(k):
    d = int(input())
    a = input().split()
    lst.append(a)
for i in range(k):
    tmp.extend(lst[i])
for j in range(1, n+1):
        if str(j) not in tmp:
            count +=1
print(count)
Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
NK = list(map(int, input().split()))
ans = [0]*NK[0]

for i in range(0,NK[1]):
  d = int(input())
  table  = list(map(int, input().split()))
  for j in range(0,NK[0]):
    if table.count(j) != 0:
      ans[j-1] = 1
print(NK[1]-sum(ans))

Failing test case input:
3 0
2
1 3
1
3

Expected output:
3


Actual output:
0


Fixed submission (verdict: Accepted):
NK = list(map(int, input().split()))
ans = [0]*NK[0]

for i in range(0,NK[1]):
  d = int(input())
  table  = list(map(int, input().split()))
  for j in range(1,NK[0]+1):
    if table.count(j) != 0:
      ans[j-1] = 1
print(NK[0]-sum(ans))

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
nk = input().split()
NK =[int(x) for x in nk]
t = []
s = []

for i in range(1,NK[1]+1):
    s.append(i)
    d = int(input())
    A =  input().split()
    a = [int(x) for x in A]
    t += a
print(t)
set_t = set(t)
set_s = set(s)
r = set_s - set_t
print(len(r))

Failing test case input:
32 -3
0
-1 0
1
0

Expected output:
32


Actual output:
[]
0


Fixed submission (verdict: Accepted):
nk = input().split()
NK =[int(x) for x in nk]
t = []
s = []
for i in range(1 ,NK[0]+1):
	s.append(i)
for i in range(1,NK[1]+1):
    d = int(input())
    A =  input().split()
    a = [int(x) for x in A]
    t += a
set_t = set(t)
set_s = set(s)
r = set_s - set_t
print(len(r))

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N,K = map(int,(input().split()))
n_list=[]
ans_list=[]
for i in range(N):
  ans_list.append(i+1)

for i in range(K):
  d = int(input())
  a_list = list(map(int, input().split()))
  n_list.extend(a_list)
  n_list = list(set(n_list))
print(*list(set(ans_list)-set(n_list)))

Failing test case input:
7 -14
-2
1 0
0
0

Expected output:
7


Actual output:
1 2 3 4 5 6 7


Fixed submission (verdict: Accepted):
N,K = map(int,(input().split()))
n_list=[]
ans_list=[]
for i in range(N):
  ans_list.append(i+1)

for i in range(K):
  d = int(input())
  a_list = list(map(int, input().split()))
  n_list.extend(a_list)
  n_list = list(set(n_list))
print(len(list(set(ans_list)-set(n_list))))

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n, k = map(int, input().split())

lis = [0] * n

for i in range(k):
    num = int(input())
    dos = list(map(int, input().split()))
    for k in range(num):
        lis[k] += 1

count =0
for p in range(n):
    if lis[p] == 0:
        count += 1
        
print(count)

Failing test case input:
3 3
0
3
1
3
1
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
n, k = map(int, input().split())

lis = [0] * n

for i in range(k):
    num = int(input())
    dos = list(map(int, input().split()))
    for k in range(num):
        lis[dos[k]-1] += 1

count =0
for p in range(n):
    if lis[p] == 0:
        count += 1
        
print(count)
Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N, K = map(int, input().split())
treat = []
for i in range(K):
    d = int(input())
    snack = input().split()
    for l in snack:
        if snack not in treat:
            treat.append(snack)
print(N-len(treat))


Failing test case input:
5 1
2
1 3
1
3

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
N, K = map(int, input().split())
treat = []
for i in range(K):
    d = int(input())
    snack = input().split()
    for l in snack:
        if l not in treat:
            treat.append(l)
print(N-len(treat))

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):






N,K =map(int, input().split())



sum=0



List_A_all = list(range(3*K+1))
List_A_all =[]



for i in range(K):

    List_d = int(input())

    List_A = input().split()
    List_A_int= [int(s) for s in List_A]
    List_A_all.extend(List_A_int)



for t in range(N):
    if not t in List_A_all:
        sum+=1



print(sum)











 

























Failing test case input:
3 3
1
3
1
3
1
3

Expected output:
2

Actual output:
3


Fixed submission (verdict: Accepted):






N,K =map(int, input().split())



sum=0



List_A_all = list(range(3*K+1))
List_A_all =[]



for i in range(K):

    List_d = int(input())

    List_A = input().split()
    List_A_int= [int(s) for s in List_A]
    List_A_all.extend(List_A_int)



for t in range(N):
    if not t+1 in List_A_all:
        sum+=1



print(sum)

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n, k = map(int, input().split())
all_sunuke = [1]*n

for i in range(0,k):
  d = int(input())
  a = list(map(int, input().split()))
  for j in range(0,d):
    if a[j] != 0:
      all_sunuke[j] =all_sunuke[j]*0

print(sum(all_sunuke))


Failing test case input:
3 3
0
3
1
3
1
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
n, k = map(int, input().split())
all_sunuke = [1]*n

for i in range(0,k):
  d = int(input())
  a = list(map(int, input().split()))
  for j in range(0,d):
      all_sunuke[(a[j]-1)] =all_sunuke[(a[j]-1)]*0

print(sum(all_sunuke))

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
from collections import defaultdict

N, K = list(map(int, input().split()))
d = {}
for i in range(1, N+1):
    d[i] = []
print(d)
for k in range(1, K):
    input()
    for i in map(int, input().split()):
        d[i].append(k)
count = 0
for i in range(1, N+1):
    if len(d[i]) == 0:
        count += 1
print(count)


Failing test case input:
2 0
0
0 1
16
-3

Expected output:
2


Actual output:
{1: [], 2: []}
2


Fixed submission (verdict: Accepted):
from collections import defaultdict

N, K = list(map(int, input().split()))
d = {}
for i in range(1, N+1):
    d[i] = []
for k in range(1, K+1):
    input()
    for i in map(int, input().split()):
        d[i].append(k)
count = 0
for i in range(1, N+1):
    if len(d[i]) == 0:
        count += 1
print(count)
Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N,K = map(int, input().split())
d = [0] * K
A = []
Nlist = []
B = 0

for n in range(101):
    Nlist.append(0)


for i in range(K):
    d[i] = int(input())
    A.append(list(map(int,input().split())))
    
for j in range(K):
    for k in range(d[j]):
        Nlist[A[j][k]] += 1

for l in range(N):
    if Nlist[l] == 0:
        B = B + 1

print(B-1)


Failing test case input:
6 -3
0
-1 0
1
-2

Expected output:
6


Actual output:
5


Fixed submission (verdict: Accepted):
N,K = map(int, input().split())
d = [0] * K
A = []
Nlist = []
B = 0

for _ in range(N):
    Nlist.append(0)


for i in range(K):
    d[i] = int(input())
    A.append(list(map(int,input().split())))

for j in range(K):
    for k in range(d[j]):
        Nlist[A[j][k]-1] += 1

for l in range(N):
    if Nlist[l] == 0:
        B = B + 1

print(B)

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):






N,K =map(int, input().split())



sum=0



List_A_all = list(range(3*K+1))
List_A_all =[]



for i in range(K):

    List_d = int(input())

    List_A = input().split()
    List_A_int= [int(s) for s in List_A]
    List_A_all.extend(List_A_int)



for t in range(K):
    if not t in List_A_all:
        sum+=1



print(sum)











 

























Failing test case input:
2 -8
-1
1 0
2
-2

Expected output:
2


Actual output:
0


Fixed submission (verdict: Accepted):






N,K =map(int, input().split())



sum=0



List_A_all = list(range(3*K+1))
List_A_all =[]



for i in range(K):

    List_d = int(input())

    List_A = input().split()
    List_A_int= [int(s) for s in List_A]
    List_A_all.extend(List_A_int)



for t in range(N):
    if not t+1 in List_A_all:
        sum+=1



print(sum)

Problem: p02688
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n, k = map(int, input().split())
s = set()
for _ in range(k):
    input()
    s.add(map(int, input().split()))
print(n - len(s))

Failing test case input:
3 3
0
3
1
3
1
1

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
n, k = map(int, input().split())
s = set()
for _ in range(k):
    input()
    a = list(map(int, input().split()))
    for i in a:
        s.add(i)
print(n - len(s))

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,k = list(map(int,input().split()))
a=[]
d=[]
c=0
for i in range(k-1):
    d+=[int(input())]
    a+=list(map(int,input().split()))
    
for i in range(1,n+1):
    if i not in a:
        c+=1
print(c)

Failing test case input:
5 1
2
1 4
2
1

Expected output:
3


Actual output:
5


Fixed submission (verdict: Accepted):
n,k = list(map(int,input().split()))
a=[]
d=[]
c=0
for i in range(k):
    d+=[int(input())]
    a+=list(map(int,input().split()))
    
for i in range(1,n+1):
    if i in a:
        continue
    else:
        c+=1
print(c)
Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N, K = map(int, input().split())
ANSlist = [1]*(N)
print(ANSlist)
for i in range(K):
    I = input() 
    S = list(input())
    for j in range(len(S)):
        if S[j] != " ":
            ANSlist[int(S[j])-1] = 0

ANS = 0

for i in range(N-1):
    if ANSlist[i] != 0:
        ANS += 1

print(ANS)

Failing test case input:
0 -1
4
1 1
9
-1

Expected output:
0


Actual output:
[]
0


Fixed submission (verdict: Accepted):
N, K = map(int, input().split())

ANSlist = []
ANS = 0

for i in range(K):
    I = input() 
    S = input().split()
    
    for j in range(len(S)):
        if S[j] != " ":
            
            if not S[j] in ANSlist:
                ANSlist.append(S[j])
                
            



ANS = N - len(ANSlist)
print(ANS)

Problem: p02688
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N, K = [int(x) for x in input().split()]
s = set()
for i in range(K):
    d = int(input())
    if d == 1:
        s.add(int(input()))
    else:
        for a in input().split():
            s.add(int(a))
ans = sum([a not in s for a in range(1, K+1)])
print(ans)


Failing test case input:
3 -2
1
0 0
14
-1

Expected output:
3


Actual output:
0


Fixed submission (verdict: Accepted):
N, K = [int(x) for x in input().split()]
s = set()
for i in range(K):
    d = int(input())
    if d == 1:
        s.add(int(input()))
    else:
        for a in input().split():
            s.add(int(a))
ans = sum([a not in s for a in range(1, N+1)])
print(ans)

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
from collections import defaultdict

import sys
sys.setrecursionlimit(10**6)
ii = lambda: int(input())
mis = lambda: map(int,input().split())
lmis = lambda: list(mis())
INF = float('inf')

def main():
    n,k=mis()
    nlis=[0]*(n+1)
    for _ in range(k):
        d=ii()
        a=input().split()
        for i in range(len(a)):
            x=int(a[i])
            nlis[x]+=1
    cnt=0
    for i in range(n):
        if nlis[i]==0: cnt+=1
    print(cnt-1)



if __name__ == "__main__":
    main()

Failing test case input:
1 -1
2
1 2
8
-1

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
from collections import defaultdict

import sys
sys.setrecursionlimit(10**6)
ii = lambda: int(input())
mis = lambda: map(int,input().split())
lmis = lambda: list(mis())
INF = float('inf')

def main():
    n,k=mis()
    nlis=[0 for _ in range(n+1)]
    for _ in range(k):
        d=ii()
        a=input().split()
        for i in range(d):
            x=int(a[i])
            nlis[x]+=1
    cnt=0
    for i in range(1,n+1):
        if nlis[i]==0: cnt+=1
    print(cnt)



if __name__ == "__main__":
    main()
Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,k = map(int,input().split())

a_list =[]
for i in range(k):
    d = int(input())
    a = list(map(int,input().split()))
    a_list = a_list + a

t = 0
for i in range(1,n+1):
    if i in a_list:
        t += 1
print(t)

Failing test case input:
1 -4
-2
0 -1
2
-2

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
n,k = map(int,input().split())

a_list =[]
for i in range(k):
    d = int(input())
    a = list(map(int,input().split()))
    a_list = a_list + a

t = 0
for i in range(1,n+1):
    if i in a_list:
        t += 1
print(n-t)

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def main():
  s = list(map(int,input().split()))
  n = [0]*s[0]
  for k in range(0,s[1],1):
    d = int(input())
    a = list(map(int,input().split()))
    
    for i in range(0,d,1):
      
      n[a[i]-1] = 1
      
      
  sum=0
  print(n)
  
  for k in range(0,s[0],1):  
    if(n[k]==0): sum = sum+1
 
  print(sum)
  
main()

Failing test case input:
2 0
0
0 0
14
-1

Expected output:
2


Actual output:
[0, 0]
2


Fixed submission (verdict: Accepted):
def main():
  s = list(map(int,input().split()))
  n = [0]*s[0]
  for k in range(0,s[1],1):
    d = int(input())
    a = list(map(int,input().split()))
    
    for i in range(0,d,1):
      
      n[a[i]-1] = 1
      
      
  sum=0
  
  
  for k in range(0,s[0],1):  
    if(n[k]==0): sum = sum+1
 
  print(sum)
  
main()

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,k=map(int,input().split())
s=set()
for i in range(k):
  d=int(input())
  s=s|set(map(int,input().split()))
print(s)
ans=n-len(s)
print(ans)

Failing test case input:
2 0
0
0 1
16
-4

Expected output:
2


Actual output:
set()
2


Fixed submission (verdict: Accepted):
n,k=map(int,input().split())
s=set()
for i in range(k):
  d=int(input())
  s=s|set(map(int,input().split()))
ans=n-len(s)
print(ans)

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n, k = map(int, input().split())

okashi = set(list(range(1, n)))

for i in range(k):
    d = int(input())
    A = set(map(int, input().split()))
    okashi = okashi - A 
print(len(okashi))

Failing test case input:
3 -3
0
-1 0
1
-2

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
n, k = map(int, input().split())

okashi = set(list(range(1, n+1)))

for i in range(k):
    d = int(input())
    A = set(map(int, input().split()))
    okashi = okashi - A 
    
print(len(okashi))
Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N, K = map(int, input().split())

ANSlist = []
ANS = 0

for i in range(K):
    I = input() 
    S = input().split()
    print(ANSlist)
    for j in range(len(S)):
        if S[j] != " ":
            
            if not S[j] in ANSlist:
                ANSlist.append(S[j])
                
            



ANS = N - len(ANSlist)
print(ANS)

Failing test case input:
5 1
2
1 4
2
1

Expected output:
3


Actual output:
[]
3


Fixed submission (verdict: Accepted):
N, K = map(int, input().split())

ANSlist = []
ANS = 0

for i in range(K):
    I = input() 
    S = input().split()
    
    for j in range(len(S)):
        if S[j] != " ":
            
            if not S[j] in ANSlist:
                ANSlist.append(S[j])
                
            



ANS = N - len(ANSlist)
print(ANS)

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N,K=map(int,input().split())
l=[list(map(int, input().split())) for i in range(2*K)]

s=[]
for j in range(1,K+1,2):
    s.append(l[j])

counts=0
for k in range(1,K+1,2):
    for n in range(1,N+1):
        if l[k].count(n)==0:
            counts+=1

print(counts)        

Failing test case input:
1 -2
4
0 1
20
-2

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
N,K=map(int,input().split())
d=[]
a=[]
for i in range(K):
    d.append(int(input()))
    a.append(list(map(int,input().split())))
    
aa=[0]*N
counts=0

for k in a:
    for j in k:
        aa[j-1]+=1
        
for x in aa:
    if x==0:
        counts+=1

print(counts)

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n, k = map(int, input().split())
ans = [0] * n

for i in range(k):
    d = int(input())
    q = list(map(int, input().split()))
    for j in range(d):
        ans[j - 1] = 1

print(ans.count(0))

Failing test case input:
3 3
0
3
1
3
1
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
n, k = map(int, input().split())
ans = [0] * n

for i in range(k):
    d = int(input())
    q = list(map(int, input().split()))
    for j in q:
        ans[j - 1] = 1

print(ans.count(0))
Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N, K = map(int, input().split())
A = []
A_row = []
check = []
count = 0

for i in range(0, K):
    d = int(input())
    A = list(map(int, input().split()))
    A_row += A

for i in range(1, N + 1):
    check.append(i)

for i in range(0, N):
    for j in range(0, K):
        if check[i] == A_row[j]:
            check[i] = 'None'

for i in range(0, len(check)):
    if check[i] != 'None':
        count += 1
print(str(count))


Failing test case input:
3 1
2
1 3
1
3

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
N, K = map(int, input().split())
A = []
A_row = []
check = []
count = 0

for i in range(0, K):
    d = int(input())
    A = list(map(int, input().split()))
    A_row += A

for i in range(1, N + 1):
    check.append(i)

for i in range(0, N):
    for j in range(0, len(A_row)):
        if check[i] == A_row[j]:
            check[i] = 'None'

for i in range(0, len(check)):
    if check[i] != 'None':
        count += 1
print(str(count))

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,k = [int(x) for x in input().split(' ')]

def solve(n, k):
    snukes = [None] * n
    victims = 0

    for i in range(k):
        snacks = int(input())
        snukes_snacks = [int(z) for z in input().split(' ')]
        for j in range(snacks):
            snukes[j-1] = snukes_snacks[j-1]

    for w in range(n):
        if snukes[w] is None:
            victims += 1
    
    print(victims)

solve(n, k)

Failing test case input:
3 3
0
3
1
3
1
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
n,k = [int(x) for x in input().split(' ')]
 
def solve(n, k):
    snukes = [None] * n
    victims = 0
    
    for i in range(k):
        snacks = int(input())
        snukes_snacks = [int(z) for z in input().split(' ')]
        for j in range(snacks):
            snukes[snukes_snacks[j] - 1] = snukes_snacks[j]
    
    for w in range(n):
        if snukes[w] is None:
            victims += 1
    
    print(victims)
 
solve(n, k)

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import itertools
N, K = map(int, input().split())
snack = [list(map(int, input().split())) for i in range(2*K)]
answer = []
person = 0

for i in snack[1::2]:
    for j in i:
      if not j in answer:
        answer.append(j)
      else:
        break
    else:
	    person += 1
print(person)

Failing test case input:
3 -1
1
1 2
7
-1

Expected output:
3


Actual output:
0


Fixed submission (verdict: Accepted):
import itertools
N, K = map(int, input().split())
snack = [list(map(int, input().split())) for i in range(2*K)]
answer = [int(i) for i in range(1, N+1)]

for i in snack[1::2]:
  for j in i:
    try:
      answer.remove(j)
    except:
      continue
print(len(answer))
Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,k = list(map(int, input().split()))
hoge = [1] * n

for i in range(k * 2):
  if i % 2 == 0:
    a = list(map(int, input().split()))
    for j in a:
      hoge[j - 1] = 0
      
print(sum(hoge))


Failing test case input:
3 3
0
3
1
3
1
3

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
n,k = list(map(int, input().split()))
hoge = [1] * n

for i in range(k * 2):
  a = list(map(int, input().split()))
  if i % 2 != 0:
    for j in a:
      hoge[j - 1] = 0
      
print(sum(hoge))

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
if __name__ == '__main__':
    N, K = map(int, input().split())

    max_d = 0
    for i in range(K):
        d = int(input())
        A = list(map(int, input().split()))
        max_d = max(max_d, d)

    print(N - max_d)




Failing test case input:
3 3
0
3
1
3
1
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
if __name__ == '__main__':
    N, K = map(int, input().split())

    sunuke = [False for _ in range(N)]
    for i in range(K):
        d = int(input())
        A = list(map(int, input().split()))
        for a in A:
            sunuke[a-1] = True

    print(sunuke.count(False))

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N, K = map(int, input().split())
l = [list(map(int, input().split())) for _ in range(2 * K)]

treated = (list(range(1, N+1)))

for i in range(int((K+1)/2)):
  tt = list(set(list(range(1, N+1))) - set(l[2*i+1]))
  treated = list(set(treated) & set(tt))

print(len(treated))

Failing test case input:
3 3
0
3
1
3
1
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
N, K = map(int, input().split())
l = [list(map(int, input().split())) for _ in range(2 * K)]

treated = (list(range(1, N+1)))

for i in range(K):
  tt = list(set(list(range(1, N+1))) - set(l[2*i+1]))
  treated = list(set(treated) & set(tt))

print(len(treated))

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import itertools

N, K = list(map(int, input().split()))

mans = []
for i in range(1, N+1):
    mans.append(i)

hasmans=[]
for ii in range(K):
    d = int(input())
    hasmans.append(list(map(int, input().split())))

hasmans = itertools.chain.from_iterable(hasmans)

print(*list(set(mans) - set(hasmans)))

Failing test case input:
2 -1
0
1 2
7
-1

Expected output:
2


Actual output:
1 2


Fixed submission (verdict: Accepted):
import itertools

N, K = list(map(int, input().split()))

mans = []
for i in range(1, N+1):
    mans.append(i)

hasmans=[]
for ii in range(K):
    d = int(input())
    hasmans.append(list(map(int, input().split())))

hasmans = itertools.chain.from_iterable(hasmans)

print(len(list(set(mans) - set(hasmans))))
Problem: p02688
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n, k = map(int, input().split())
s = set()
for _ in range(k):
    d = int(input())
    a = tuple(map(int, input().split()))
    for _a in a:
        s.add(a)

print(n - len(s))

Failing test case input:
5 1
2
1 4
2
3

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
n, k = map(int, input().split())
s = set()
for _ in range(k):
    d = int(input())
    a = tuple(map(int, input().split()))
    for _a in a:
        s.add(_a)

print(n - len(s))

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,k=map(int,input().split())
d=list()
array=list()
for i in range(k):
	d.extend(input())
	array.extend(input())


print(n-len(set(array)))

Failing test case input:
5 1
2
1 3
1
3

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
n,k=map(int,input().split())
d=list()
array=list()
for i in range(k):
	d.extend(input())
	array.extend(input().split())

print(n-len(set(array)))

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N, K = map(int, input().split())

max_n = 0
for i in range(K):
    d = int(input())
    A = list(map(int, input().split()))
    max_n = max(max_n, d)

print(N - max_n)


Failing test case input:
3 3
0
3
1
3
1
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
N, K = map(int, input().split())

max_n = 0
result = set()
for i in range(K):
    d = int(input())
    A = list(map(int, input().split()))
    for j in A:
        result.add(j)

print(N - len(result))

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N, K = map(int, input().split())

cnt = []
for i in range(K):
    A = []
    d = int(input())
    A = list(map(int, input().split()))
    for j in range(d):
        if not A[j] in cnt:
            cnt.append(A[j])

ans = 0

for i in range(1, N):
    if not i in cnt:
        ans += 1

print(ans)

Failing test case input:
5 1
2
1 4
1
3

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
N, K = map(int, input().split())

cnt = []
for i in range(K):
    A = []
    d = int(input())
    A = list(map(int, input().split()))
    for j in range(d):
        if not A[j] in cnt:
            cnt.append(A[j])

ans = 0

for i in range(1, N + 1):
    if not i in cnt:
        ans += 1

print(ans)

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,k = map(int,input().split())
List = [list(map(int, input().split())) for i in range(2*k)]
List_a = []
for x in range(1,2*k,2):
    for i in List[x]:
        List_a.append(i)

List_a =set(List_a)
print(List_a)
print(n-len(List_a))

Failing test case input:
12 -2
1
0 0
0
-1

Expected output:
12


Actual output:
set()
12


Fixed submission (verdict: Accepted):
n,k = map(int,input().split())
List = [list(map(int, input().split())) for i in range(2*k)]
List_a = []
for x in range(1,2*k,2):
    for i in List[x]:
        List_a.append(i)

List_a =set(List_a)
print(n-len(List_a))
Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,k = map(int,input().split())
t = [0] * n

for _ in range(k):
    d = int(input())
    a = list(map(int,input().split()))

    for e in a:
        t[e-1] += 1
ans = 0
l = [i for i in t if i != 0]
print(len(l))

Failing test case input:
2 -8
-1
1 -1
2
-2

Expected output:
2


Actual output:
0


Fixed submission (verdict: Accepted):
n,k = map(int,input().split())
t = [0] * n

for _ in range(k):
    d = int(input())
    a = list(map(int,input().split()))

    for e in a:
        t[e-1] += 1
ans = 0
l = [i for i in t if i == 0]

print(len(l))

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N, K = list(map(int, input().split()))
d=[0] * K
A=[0] * K
okashi_sunuke = list()
for i in range(K):
    d[i] = int(input())
    A[i] = list(map(int, input().split()))
    okashi_sunuke += A[i]

sunuke = 0
for i in range(N):
    if i in okashi_sunuke:
        sunuke +=1

print(N-sunuke)






Failing test case input:
3 2
2
1 3
1
3

Expected output:
1

Actual output:
2


Fixed submission (verdict: Accepted):
N, K = list(map(int, input().split()))
d=[0] * K
A=[0] * K
okashi_sunuke = list()
for i in range(K):
    d[i] = int(input())
    A[i] = list(map(int, input().split()))
    okashi_sunuke += A[i]

sunuke = 0
for i in range(1,N+1):
    if i in okashi_sunuke:
        sunuke +=1

print(N-sunuke)

Problem: p02688
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N, K = map(int, input().split())

sunuke = [1] * N

for i in range(K):
    tmp = map(int, input().split())
    for t in tmp:
        sunuke[t-1] = 0
print(sum(sunuke))

Failing test case input:
3 1
2
1 3
1
3

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
N, K = map(int, input().split())

sunuke = [1] * N

for i in range(K):
    di = int(input())
    tmp = map(int, input().split())
    for t in tmp:
        sunuke[t-1] = 0
print(sum(sunuke))

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
NK = list(map(int, input().split()))
N=NK[0]
K=NK[1]
sunukes = [i+1 for i in range(N)]
for i in range(K):
  d = int(input())
  A = map(int, input().split())
  for a in A:
    if a in sunukes:
      sunukes.remove(a)

print(sunukes)

Failing test case input:
1 -1
2
1 2
5
-1

Expected output:
1


Actual output:
[1]


Fixed submission (verdict: Accepted):
NK = list(map(int, input().split()))
N=NK[0]
K=NK[1]
sunukes = [i+1 for i in range(N)]
for i in range(K):
  d = int(input())
  A = map(int, input().split())
  for a in A:
    if a in sunukes:
      sunukes.remove(a)

print(len(sunukes))
Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
[N, K] = list(map(int, input().split()))
all_A =[]

for i in range(1, N + 1):
    all_A.append(i)
for j in range(K):
    d = int(input())
    A = list(map(int, input().split()))
    all_A = set(all_A) ^ set(A)
print(len(all_A))

Failing test case input:
3 3
0
3
1
3
1
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
[N, K] = list(map(int, input().split()))
all_A =[]
AB = []
for i in range(1, N + 1):
    all_A.append(i)
for j in range(K):
    d = int(input())
    A = list(map(int, input().split()))
    AB = AB + A
last_A = set(all_A) ^ set(AB)
print(len(last_A))

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N, K = map(int, input().split())
l = [list(map(int, input().split())) for _ in range(2 * K)]

treated = (list(range(1, N+1)))

for i in range(int((K+1)/2)):
  tt = list(set(list(range(1, N+1))) - set(l[2*i+1]))
  print(tt)
  treated = list(set(treated) & set(tt))

print(len(treated))

Failing test case input:
3 1
2
1 3
1
3

Expected output:
1


Actual output:
[2]
1


Fixed submission (verdict: Accepted):
N, K = map(int, input().split())
l = [list(map(int, input().split())) for _ in range(2 * K)]

treated = (list(range(1, N+1)))

for i in range(K):
  tt = list(set(list(range(1, N+1))) - set(l[2*i+1]))
  treated = list(set(treated) & set(tt))

print(len(treated))

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,k = map(int,input().split())

set_i = set()

for i in range(0,k,2):
  d = input()
  s = map(int,input().split())
  for s_ in s:
    set_i.add(s_)

print(n-len(set_i))


Failing test case input:
3 3
0
3
1
3
1
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
n,k = map(int,input().split())

set_i = set()

for i in range(k):
  d = input()
  s = map(int,input().split())
  for s_ in s:
    set_i.add(s_)

print(n-len(set_i))

Problem: p02688
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n, k = list(map(int, input().split()))
snukes = []
for x in range(k):
    input()
    y = ((list(map(int, input().split()))))
    for i in y:
        snukes.append(i)

print(len(snukes) - len(set(snukes)))


Failing test case input:
5 1
2
1 4
1
3

Expected output:
3


Actual output:
0


Fixed submission (verdict: Accepted):
n, k = list(map(int, input().split()))
snukes = [0] * n
for x in range(k):
    input()
    y = ((list(map(int, input().split()))))
    for i in y:
        snukes[i - 1] = 1

print(snukes.count(0))