TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
def Qb():
    n, k = map(int, input().split())
    ans = set()
    for v in range(k):
        d = int(input())
        ans.add(tuple(int(v) for v in input().split()))
        print(f'{d=}')
        print(f'{ans=}')
    print(n - len(ans))


if __name__ == '__main__':
    Qb()


def Qb():
    n, k = map(int, input().split())
    ans = set()
    for v in range(k):
        d = int(input())
        ns = [int(v) for v in input().split()]
        for N in ns:
            ans.add(N)
    print(n - len(ans))


if __name__ == '__main__':
    Qb()


Verdicts: Wrong Answer

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
N , K = map(int, input().split())
has = set()
for _ in range(K):
    d = int(input())
    has = set(map(int, input().split()))
print(N - len(has))

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

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
n,k=map(int,input().split())
x=[c for c in range(1,n+1)]
for i in range(1,k+1):
  d=int(input())
  s=input().split()
  for b in range(d):
    if int(s[b]) in x:
      x.remove(int(s_i[b]))
print(len(x))


n,k=map(int,input().split())
x=[c for c in range(1,n+1)]
for i in range(1,k+1):
  d=int(input())
  s=input().split()
  for b in range(d):
    if int(s[b]) in x:
      x.remove(int(s[b]))
print(len(x))

Verdicts: Runtime Error

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
N, K =map(int, input().split())
snuke = [0]*N

for i in range(K):
    d = int(input())
    a = list(map(int,input().split()))
    for j in range(d):
        snuke[a[j]] = 1

print(snuke.count(0))

N, K =map(int, input().split())
snuke = [0]*N

for i in range(K):
    d = int(input())
    a = list(map(int,input().split()))
    for j in range(d):
        snuke[a[j]-1] = 1

print(snuke.count(0))

Verdicts: Runtime Error

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
n, k = map(int, input().split())
kids = list()
for i in range(k):
    d = input()
    kids += list(map(int, input().split()))
res = 0
print(kids)
for i in range(1,n+1):
    if i not in kids:
        res+= 1
print(res)

n, k = map(int, input().split())
kids = list()
for i in range(k):
    d = input()
    kids += list(map(int, input().split()))
res = 0
for i in range(1,n+1):
    if i not in kids:
        res+= 1
print(res)

Verdicts: Wrong Answer

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
N,K=map(int, input().split(" "))
d=[0]*K
A=[0]*K
dic={}
for i in range(K):
    d[i]=int(input())
    A[i]=input().split()
for j in range(K):
    if d[j]==1:
        if A[j][0] not in dic:
                dic[A[j][0]]=1
    if d[j]!=1:
        print(A[j])
        for k in range(d[j]):
            if A[j][k] not in dic:
                dic[A[j][k]]=1
print(dic)
print(N-len(dic))

N,K=map(int, input().split(" "))
d=[0]*K
A=[0]*K
dic={}
for i in range(K):
    d[i]=int(input())
    A[i]=input().split()
for j in range(K):
    if d[j]==1:
        if A[j][0] not in dic:
                dic[A[j][0]]=1
    if d[j]!=1:
        for k in range(d[j]):
            if A[j][k] not in dic:
                dic[A[j][k]]=1
print(N-len(dic))

Verdicts: Wrong Answer

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
total, kinds = map(int, input().split())

l = [False]*total
print(list)

for i in range(kinds):
    non = input()
    people = list(map(int, input().split()))
    for j in range(len(people)) :
        l[people[j]-1] = True
    
print(l.count(False))

total, kinds = map(int, input().split())

l = [False]*total

for i in range(kinds):
    non = input()
    people = list(map(int, input().split()))
    for j in range(len(people)) :
        l[people[j]-1] = True
    
print(l.count(False))

Verdicts: Wrong Answer

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
nk = list(input().split())
n = nk[0]
k = nk[1]
a = []
c = 0
for i in range(k):
  d = int(input())
  b = list(input().split())
  a.extend(b)
for j in range(1,n+1):
  if j not in a:
    c = c+1
print(c)

nk = list(input().split())
n = nk[0]
k = nk[1]
a = []
for i in range(1,k+1):
  d = int(input())
  b = list(input().split())
  a.entend(b)
c = 0
for j in range(1,n+1):
  if j not in a:
    c = c+1
print(c)
  

nk = list(input().split())
n = nk[0]
k = nk[1]
a = []
c = 0
for i in range(int(k)):
  d = int(input())
  b = list(input().split())
  a.extend(b)
for j in range(1,int(n)+1):
  if str(j) not in a:
    c = c+1
print(c)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
N,K= map(int, input().split())

A=[]

for i range(K):
    d = int(input())
    A[i] = [int(x) for x in input().split()]

print(3)

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

A=[]

for i range(K)
    d = int(input())
    A[i] = [int(x) for x in input().split()]

print("A")

Sunuke=[]

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

    Sunuke.extend(A)

print(N-(len(set(Sunuke))))


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
N, K = map(int, input().split())
has_snack = [False]*N

for i in range(K):
    d = int(input())
    A = list(map(int, input().split()))
    for v in A:
        has_snack[v-1] = True

print(sum(has_snack))


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




has_snack = set()  
for i in range(K):
    d = int(input())  
    A = set(map(int, input().split()))  
    has_snack |= A  


print(N-len(has_snack))


Verdicts: Wrong Answer

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
n,k=list(map(int,input().split()))
h=[range(1,n+1)]
a=[]
for i in range(k):
    d=int(input())
    b=list(map(int,input().split()))
    a.append(*b)
c=set(a)
ans=n-len(c)
print(ans)

N,K=list(map(int,input().split()))
h=[]
for k in range(K):
    d_i=int(input())
    a=list(map(int,input().split()))
    for i in range(d_i):
        h.append(a[i])
h2=set(h)
ans=N-len(h2)
print(ans)

Verdicts: Runtime Error

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
def check(human):
    sum = 0
    for i in human:
        if(i == 0):
            sum += 1
    return sum

def resolve():
    data = [int(i) for i in input().split()]
    
    human = [0 for i in range(data[0])]
    sweet = data[1]
    
    for i in range(sweet):
        mem = int(input())
        have = [int(j) for j in input().split()]
        
        for k in have:
            human[k-1] += 1
    
    print(check(human))

def check(human):
    sum = 0
    for i in human:
        if(i == 0):
            sum += 1
    return sum

def resolve():
    data = [int(i) for i in input().split()]
    
    human = [0 for i in range(data[0])]
    sweet = data[1]
    
    for i in range(sweet):
        mem = int(input())
        have = [int(j) for j in input().split()]
        
        for k in have:
            human[k-1] += 1
    
    print(check(human))
resolve()

Verdicts: Wrong Answer

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
N,K=map(int,input().split())
l=[False for _ in range(N)]
for i in range(K):
    d=int(input())
    A=list(map(int,input().split()))
    for j in range(N):
        if l[j]==A[j]:
            l[j]=True
print(list.count(False)) 

N,K=map(int,input().split())
l=[False for _ in range(N)]
for i in range(K):
    d=int(input())
    A=list(map(int,input().split()))
    for j in range(N):
        if l[i]==A[i]:
            l[i]=True
print(list.count(False))

N,K=map(int,input().split())
l=[False for x in range(N)]
for i in range(K):
    d=int(input())
    A=list(map(int,input().split()))
    for j in A:
        l[j-1]=True
print(l.count(False))   

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
n,k=map(int,input().split())
m=[]
for i in range(n):
  d=int(input())
  a=list(map(int,input().split()))
  for i in a:
    m=m.append(i)
j=set(m)
print(n-len(j))
  
  

N,K=map(int,input())
B=[]
for i in range(K):
  D=int(input())
  A=list(map(int,input().split()))
  for j in A:
    B.append(j)
print(N-len(set(B)))

n,k=map(int,input().split())
m=[]
for i in range(k):
  d=int(input())
  a=list(map(int,input().split()))
  for p in a:
    m.append(p)
j=set(m)
print(n-len(j))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
N,K = map(int,input().split())
A = [[0 for j in range(100)]for i in range(100)]
B = [0 for j in range(N)]
S = 0
for i in range(K):
    d = int(input())
    A[i] = list(map(int,input().split()))
for i in range(100):
    for j in range(100):
        for k in range(N):
            if A[i][j] == k+1:
                B[k] = 1
for i in range(N):
    if B[i] != 1:
        S += 1
print (S)

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

Verdicts: Runtime Error

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
N, K = [int(ipt) for ipt in input().split(' ')]

sunukekuns = [str(i) for i in range(N)]

for k in range(K):
  _ = input()
  sunukekun = input().split(' ')
  for (kun in sunukekun):
    if kun in sunukekuns:
      sunukekuns.remove(kun)

print(len(sunukekuns))


N, K = input().split(' ')

sunukekuns = [i for i in range(N)]

for k in range(K):
  _, sunukekun = input(), input().split(' ')
  for (kun in sunukekun):
    if kun in sunukekuns:
      sunukekuns.remove(kun)

print(len(sunukekuns))

N, K = [int(ipt) for ipt in input().split(' ')]

sunukekuns = [str(i) for i in range(N)]

for k in range(K):
  _ = input()
  sunukekun = input().split(' ')
  for kun in sunukekun:
    if kun in sunukekuns:
      sunukekuns.remove(kun)

print(len(sunukekuns))


N, K = [int(ipt) for ipt in input().split(' ')]

sunukekuns = [str(i+1) for i in range(N)]

for k in range(K):
  _ = input()
  sunukekun = input().split(' ')
  for kun in sunukekun:
    if kun in sunukekuns:
      sunukekuns.remove(kun)

print(len(sunukekuns))


Verdicts: Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
a ,b= map(int,input().split())
aaa = [list(map(int,input().split())) for i in range(b*2)]
 
s = {i+1 for i in range(a)}

for i in range(1,a+1,2):
    for k in aaa[i]:
        for j in k:
            s.discard(j)
print(len(s))

a,b = map(int,input().split())
aaa = [list(map(int,input().split())) for i in range(b*2)]

c = set()
e = set([i for i in range(1,a+1)])
for i in range(1,len(aaa),2):
  for k in aaa[i]:
     e.discard(k)

print(len(e))

Verdicts: Runtime Error

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
n, k = map(int, input().split())
n_list = [1]*n
for _ in range(b):
  _ = input()
  for i in range(list(map(int, input().split()))):
    n_list[i-1] = 0
print(sum(n_list))

n, k = map(int, input().split())
n_list = [1]*n
for _ in range(k):
  _ = input()
  for i in range(list(map(int, input().split()))):
    n_list[i-1] = 0
print(sum(n_list))


n, k = map(int, input().split())
n_list = [1]*n
for _ in range(k):
  _ = input()
  for i in list(map(int, input().split())):
    n_list[i-1] = 0
print(sum(n_list))


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
N,K = map(int,input().split())
c = 0
listA = []
for k in range(1,K+1):
    d = int(input())
    listA += list(map(int,input().split()))
    
for n in range(1,N+1):
    if n in listA:
        c += 1
print(c)        

N,K = map(int,input().split())
c = 0
listA = []
for k in range(1,K+1):
    d = int(input())
    listA += list(map(int,input().split()))
    
for n in range(1,N+1):
    if n not in listA:
        c += 1
print(c)     

Verdicts: Wrong Answer

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
def main():
    count = 0
    ans = []
    N, K = map(int, input().split())
    for _ in range(K):
        d = int(input())
        a = [input() for _ in range(d)]
        ans.append(a)
    for _ in range(1, N + 1):
        if _ not in ans:
            count += 1

    print(count)
    return

main()

def main():
    ans = []
    N, K = map(int, input().split())

    for i in range(K):
        d = int(input())
        a = map(int, input().split())
        for j in a:
            ans.append(j)

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

    print(count)
    return

main()

Verdicts: Runtime Error

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
N, K = map(int,input().split())
state = [1 for i in range(N)]
for i in range(K):
  d = int(input())
  for j in range(d):
    x = list(map(int,input().split()))
    for k in x:
      state[x-1] = 0
print(sum(state))

N, K = map(int,input().split())
state = [1 for i in range(N)]
for i in range(K):
  d = int(input())
  for j in range(d):
    x = list(map(int,input().split()))
    for k in x:
      state[k-1] = 0
print(sum(state))

N, K = map(int,input().split())
state = [1 for i in range(N)]
for i in range(K):
  d = int(input())
  #print(1,i,d)
  x = list(map(int, input().split()))
  for k in x:
    state[k-1] = 0
print(sum(state))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
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

for j in a:
    for t in j:
        aa[t - 1] += 1

ans = 0

for z in aa:
    if z == 0:
        ans += 0

print(ans)

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

for j in a:
    for t in j:
        aa[t - 1] += 1

ans = 0

for z in aa:
    if z == 0:
        ans += 1
    else:
        ans += 0

print(ans)

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

for j in a:
    for t in j:
        aa[t - 1] += 1

ans = 0

for z in aa:
    if z == 0:
        ans += 1
    else:
        ans += 0

print(ans)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
from collections import Counter
N,K = list(map(int,input().split()))

snk_sweets = []

for i in range(K):
    try:
        sweets = int(input())
        snk_sweets = (list(int(x) for x in input().split()))

    except:
        break;

counter_snk = Counter(snk_sweets)
len_snk = len(counter_snk.keys())
print(N - len_snk)

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

snk_sweets = []

for i in range(K):
    sweets = input()
    snk_sweets = snk_sweets + input().split()

len_snk = len(set(snk_sweets))
print(N - len_snk)


Verdicts: Wrong Answer

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
from collections import Counter
N,K=map(int,input().split())
ans=[0]*N
print(ans)

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


ac = Counter(ans)

print(ac[0])

from collections import Counter
N,K=map(int,input().split())
ans=[0]*N

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


ac = Counter(ans)

print(ac[0])

Verdicts: Wrong Answer

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
N, K = map(int, input().split())

S = [1] * N 

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

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




S = [1] * N 

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

N, K = list(map(int, input().split()))
for i in range(1, K+1):
    d = int(input())
    N = map(int, input().split())
    print(d)
    print(N)


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




S = [1] * N 

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

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




S = [1] * N 

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

Verdicts: Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
n, k = map(int, input().split())
check = [False for i in range(n)]

for j in range(k):
  d = int(input())
  a = map(int, input().split())
  for k in a:
    check[k-1] = True

print(check.count(True))

n, k = map(int, input().split())
check = [False for i in range(n)]

for j in range(k):
  d = int(input())
  a = map(int, input().split())
  for k in a:
    check[k-1] = True

print(check.count(False))

Verdicts: Wrong Answer

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
import random
n = list(x for x in range(input()))
k = int(input())
l = 0

while l <= k:
  d = random.randint(1, n)
  print(d)
  for m in range(d):
    print(random.choice(n))
  l += 1
  

import random
n = int(input())
k = int(input())
l = 0

while l <= k:
  d = random.randint(1, n)
  print(d)
  for m in range(d):
    print(random.randint(1, n))
  l += 1
  


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

for _ in range(k):
  d = int(input())
  a += (int(m) for m in input().split())

print(n - len(a))


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

for _ in range(k):
  d = int(input())
  while m <= d:
    l = int(input())
    a.append(l)
    m += 1

print(n - len(a))


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

for _ in range(k):
  d = int(input())
  while m <= d:
    a.append(int(input()))
    m += 1

print(n - len(a))

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

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

print(n - len(a))


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

for m in range(k):
  d = int(input())
  print(d)
  for l in range(d):
    a.append(range(n))
  print(a)

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

for _ in range(k):
  d = int(input())
  a += [int(m) for m in input().split(" ")]

print(n - len(a))


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

for _ in range(k):
  d = int(input())
  a += [int(m) for m in input().split()]

print(n - len(a))


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

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

print(n - len(a))


import random
n = list(range(1, int(input())))
k = int(input())
i = 0
m = 0

while i == k:
  for d in random.randint(1, k+1):
    for m in range(d)
      print(random.choice(n))
  i += 1
  

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

for _ in range(k):
  d = int(input())
  a += [int(m) for m in input().split()]

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


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):

N, K = map(int, input().split())
A = [0] * N

for i in range(K):
    d = int(input())
    targets = list(map(int, input().split()))
    for j in range(d):
        index = targets[j-1]
        A[index] = 1

count = 0
for i in range(N):
    if A[i] == 0:
        count += 1

print(count)


N, K = map(int, input().split())
A = [0] * N

for i in range(K):
    d = int(input())
    targets = list(map(int, input().split()))
    for j in range(d):
        index = targets[j] -1
        A[index] = 1

count = 0
for i in range(N):
    if A[i] == 0:
        count += 1

print(count)


Verdicts: Runtime Error

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
import numpy as np
n,k = map(int, input().split())
l = np.zeros(n)
for i in range(k):
    d = int(input())
    a = map(int, input().split())
    for j in range(d):
        l[a[j]-1] = 1
ans = 0
for i in l:
    if(i == 0):
        ans += 1
print(ans)


import numpy as np
n,k = map(int, input().split())
l = [0 for i in range(n)]
for i in range(k):
    d = int(input())
    a = list(map(int,input().split()))
    for j in a:
        l[j-1] = 1

print(l.count(0))


Verdicts: Runtime Error

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
def main():
  N,K=map(int,input().split())
  for i in range(K):
    input()
    a |= set(list(map(int,input.split())))
  print(n-len(a))
  
 
if __name__ == "__main__":
  main()

def main():
  n, k = map(int, input().split())
  a = set()
  for i in range(k):
    input()
    a |= set(list(map(int, input().split())))
  print(n-len(a))

if __name__ == "__main__":
  main()

Verdicts: Runtime Error

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
N,K = map(int, input().split())
 
nlist = [i for i in range(1,N+1)]
 
for i in range(N):
  d = int(input())
  A = list(map(int, input().split()))
  nlist = [a for a in A if a not in nlist]
print(len(nlist))

N,K = map(int, input().split())
 
nlist = [i for i in range(1,N+1)]
 
for i in range(N):
  d = int(input())
  A = list(map(int, input().split()))
  for a in A:
    if a in nlist:
      nlist.remove(a)
print(len(nlist))

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

nlist = [i for i in range(N)]

for i in range(N):
  d = int(input())
  A = list(map(int, input().split()))
  for a in A:
    if a in nlist:
      nlist.remove(a)
print(len(nlist))

N,K = map(int, input().split())
 
nlist = [i for i in range(1,N+1)]
 
for i in range(K):
  d = int(input())
  A = list(map(int, input().split()))
  for a in A:
    if a in nlist:
      nlist.remove(a)
print(len(nlist))

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
n,k = map(int, input().split())
D=[]
A=[]
for i in range(1,k+1):
    d = set(map(int, input().split())) 
    a = set(map(int, input().split())) 
    D.extend(d)
    A.extend(a)
l = set(A)
ans = []
for i in range (1,n+1):
  if i not in l:
    ans.append(i)
if len(ans) ==1:
  print(ans[0])
else:
  print(*ans)

n,k = map(int, input().split())
D=[]
A=[]
for i in range(1,k+1):
    d = set(map(int, input().split())) 
    a = set(map(int, input().split())) 
    D.extend(d)
    A.extend(a)
l = set(A)
print(n-len(l))

Verdicts: Wrong Answer

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
N, K = list(map(int, input().split()))

Snack = [0] * N

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

    for j in range(d):
        Snack[A[j]] += 1
    
sum = 0
for i in range(N):
    if (Snack[i] == 0):
        sum += 1

print(sum)


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

Snack = [0] * N

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

    for j in range(d):
        Snack[A[d]] += 1
    
sum = 0
for i in range(N):
    if (Snack[i] == 0):
        sum += 1

print(sum)


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

Snack = [0] * N

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

    for j in range(d):
        Snack[A[j]-1] += 1
    
sum = 0
for i in range(N):
    if (Snack[i] == 0):
        sum += 1

print(sum)


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
n,m = map(int,input().split())

d = {}

for i in range(m):
    input()
    L = list(map(int,input().split()))
    for j in L:
        d[j] = j

print(n - len(L))
    

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

d = {}

for i in range(m):
    input()
    L = list(map(int,input().split()))
    #print(L)
    for j in L:
        d[j] = j

#print(d)
print(n - len(d))

Verdicts: Wrong Answer

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
n,k=map(int,input().split())

for i in range(k):
    ans=[]
    d=int(input())
    li=list(map(int,input().split()))
    for j in range(1,n+1):
        if  (j not in li) and (j not in ans):
            ans.append(j)
print(len(ans))
            
        

n,k=map(int,input().split())
ans=[]
for i in range(k):
    d=int(input())
    li=list(map(int,input().split()))
    for j in range(1,n+1):
        if  (j not in li) and (j not in ans):
            ans.append(j)
print(len(ans))


n,k=map(int,input().split())
ans=[1]*n
for _ in range(k):
    d=int(input())
    li=list(map(int,input().split()))
    for i in li:
        ans[i-1]=0
print(sum(ans))
    

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
N,K=map(int,input().split())
ans={k:0 for k in range(1,N+1)}
for i in range(1,K+1):
    d=int(input())
    l=list(map(int,input().split()))
    for item in l:
        ans[item]=ans[item]+1 
for i in ans:
    if ans[i]==0:
        print(i)

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

Verdicts: Wrong Answer

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
n,k=(int(i) for i in input().split())
l=[i for i in range(1,n+1)]
for i in range(k):
  d=input()
  for i in input().split():
    l[i]=0
c=0
for i in l:
  if(i>0):
    c+=1
print(c)

n,k=(int(i) for i in input().split())
l=[1 for i in range(1,n+1)]
for i in range(k):
  d=input()
  l1=[int(j) for j in input().split()]
  for j in l1:
      l[j-1]=0
c=0
for i in l:
  if(i>0):
    c+=1
print(c)

Verdicts: Runtime Error

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
n,m=map(int,input().split())
lis=[i for i in range(1,n+1)]
for i in range(m):
    d=int(input())
    for j in range(d):
        a=int(input())
        if a in lis:
            lis.remove(a)
print(len(lis))

n,m=map(int,input().split())
lis=[i for i in range(1,n+1)]
for i in range(m):
    d=int(input())
    a=list(map(int,input().split()))
    for j in range(d):
        if a[j] in lis:
            lis.remove(a[j])
print(len(lis))

Verdicts: Runtime Error

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
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]
        print(o)

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

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)

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)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
def do():
    n,m=map(int,input().split())
    d=int(input())
    l=[]
    for i in range(n):
        a=list(map(int,input().split()))
        l.extend(a)
    for j in range(1,n+1):
        if j not in l:
            return j
print(do())

def do():
    n,m=map(int,input().split())
    num=[]
    k=0
    for i in range(m):
        d=int(input())
        l=list(map(int,input().split()))
        num.extend(l)
    for i in range(1,n+1):
        if i not in num:
            k+=1
    return k


print(do())

Verdicts: Runtime Error

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
N,K = map(int,input().split())
number = 0
data = []
nolist = list(range(1,K+1))
print(nolist)
for i in range(N):
  number = int(input())
  for j in range(number):
    data = input().split()
    nolist[int(data[j])-1] = 0
try:
  for i in range(N):
  	nolist.remove(0)
except:
  pass
print(len(nolist))

N,K = map(int,input().split())
number = 0
data = []
nolist = list(range(1,K+1))
for i in range(N):
  number = int(input())
  for j in range(number):
    data = input().split()
    nolist[int(data[j])-1] = 0
try:
  for i in range(N):
  	nolist.remove(0)
except:
  pass
print(len(nolist))

N,K = map(int,input().split())
data = []
nolist = list(range(1,N+1))
for i in range(K):
  number = int(input())
  data = input().split()
  for j in range(number):
    nolist[int(data[j])-1] = 0
try:
  for i in range(N):
  	nolist.remove(0)
except:
  pass
print(len(nolist))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
n,k=map(int,input().split())
print(n)
print(k)
d=[[] for i in range(k)]
dlist=[]
memb=[i+1 for i in range(n)]
for i in range(k):
    d[i]=int(input())
    dklist=list(map(int,input().split()))
    dlist.append(dklist)
    print(d[i])
    print(dlist[i])
    for j in dklist:
        print(j)
        if j in memb:
            memb.remove(j)
print(len(list(memb)))

n,k=map(int,input().split())
d=[[] for i in range(k)]
dlist=[]
memb=[i+1 for i in range(n)]
for i in range(k):
    d[i]=int(input())
    dklist=list(map(int,input().split()))
    dlist.append(dklist)
    for j in dklist:
        if j in memb:
            memb.remove(j)
print(len(list(memb)))

Verdicts: Wrong Answer

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
n,k = list(map(int,input().split()))
s=set()
for i in range(k):
  s.append(int(input()))
  j=list(map(int,input().split()))
print(n-len(s))

n,k = list(map(int,input().split()))
s=set()
for i in range(k):
  int(input())
  j=set(map(int,input().split()));s=s.union(j)
print(n-len(s))

Verdicts: Runtime Error

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
N, K = map(int, input().split())
sunukes = [0 for k in range(N)]
for k in range(K):
  d = int(input())
  A = list(map(int, input().split()))
  for a in A:
    sunukes[a] += 1
  assert len(A) == d
print(len([k for k in sunukes if k == 0]))

N, K = map(int, input().split())
sunukes = [0 for k in range(N)]
for k in range(K):
  d = int(input())
  A = list(map(int, input().split()))
  for a in A:
    sunukes[a-1] += 1
  assert len(A) == d
print(len([k for k in sunukes if k == 0]))

Verdicts: Runtime Error

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

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


n,k=map(int,input().split())
seta=set()
for i in range(k):
    d=int(input())
    l=[int(i) for i in input().split()]
    for j in l:
        seta.add(j)

print(n-len(set(seta)))


Verdicts: Wrong Answer

Accepted
Problem: N _Snukes_ called Snuke 1, Snuke 2, ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Submission attempts (in order):
N, K = map(int,input().split())

C = [0 for _ in range(N)]
ct = N
for i in range(N):
  d = int(input())
  A = list(map(int, input().split()))
  for a in A:
    if C[a-1] == 0:
      C[a-1] += 1
      ct -= 1

print(ct)



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

C = [0 for _ in range(N)]
ct = N
for i in range(K):
  d = input()
  A = list(map(int, input().split()))
  for a in A:
    if C[a-1] == 0:
      C[a-1] += 1
      ct -= 1

print(ct)



Verdicts: Runtime Error

Accepted