Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
# coding: utf-8

def triangles(L, s, c, n):
    if c == len(L):
        return(n)
    if L[c] < s:
        n += 1
        return(triangles(L, s, c + 1, n))
    else:
        return(n)

N = int(input())
L = sorted(list(map(int, input().split())))
ans = 0
for i in range(N):
    for j in range(i + 1, N - 1):
        ans += triangles(L, L[i] + L[j], j + 1, 0)
print(ans)

Fixed submission:
# coding: utf-8
import bisect

N = int(input())
L = sorted(list(map(int, input().split())))
ans = 0
for i in range(N):
    for j in range(i + 1, N - 1):
        ans += max(bisect.bisect_right(L, L[i] + L[j] - 1) - j - 1, 0)
print(ans)

Buggy python submission (verdict: Runtime Error):
# coding: utf-8

def triangles(L, s, c, n):
    if c == len(L):
        return(n)
    if L[c] < s:
        n += 1
        return(triangles(L, s, c + 1, n))
    else:
        return(n)

N = int(input())
L = sorted(list(map(int, input().split())))
ans = 0
for i in range(N):
    for j in range(i + 1, N - 1):
		ans += triangles(L, L[i] + L[j], j + 1, 0)
print(ans)

Fixed submission:
# coding: utf-8
import bisect

N = int(input())
L = sorted(list(map(int, input().split())))
ans = 0
for i in range(N):
    for j in range(i + 1, N - 1):
        ans += max(bisect.bisect_right(L, L[i] + L[j] - 1) - j - 1, 0)
print(ans)

Buggy python submission (verdict: Runtime Error):
# coding: utf-8

def triangles(L, s, c, n):
    if c == len(L):
        return(n)
    if L[c] < s:
        n += 1
        return(triangles(L, s, c + 1, n))
    else:
        return(n)

N = int(input())
L = sorted(list(map(int, input().split())))
ans = 0
dp = []
for i in range(L[-2] + L[-1] + 1):
    dp.append(-1)
for i in range(N):
    for j in range(i + 1, N - 1):
        if dp[L[i] + L[j]] >= 0:
            ans += dp[L[i] + L[j]]
        else:
            dp[L[i] + L[j]] = triangles(L, L[i] + L[j], j + 1, 0)
            ans += dp[L[i] + L[j]]
print(ans)

Fixed submission:
# coding: utf-8
import bisect

N = int(input())
L = sorted(list(map(int, input().split())))
ans = 0
for i in range(N):
    for j in range(i + 1, N - 1):
        ans += max(bisect.bisect_right(L, L[i] + L[j] - 1) - j - 1, 0)
print(ans)

Buggy python submission (verdict: Runtime Error):
# coding: utf-8

def triangles(L, s, c, n):
    if c == len(L):
        return(n)
    if L[c] < s:
        n += 1
        return(triangles(L, s, c + 1, n))
    else:
        return(n)

N = int(input())
L = sorted(list(map(int, input().split())))
ans = 0
dp = []
for i in range(2001):
    dp.append(-1)
for i in range(N):
    for j in range(i + 1, N - 1):
        if dp[L[i] + L[j]] >= 0:
            ans += dp[L[i] + L[j]]
        else:
            dp[L[i] + L[j]] = triangles(L, L[i] + L[j], j + 1, 0)
            ans += dp[L[i] + L[j]]
print(ans)

Fixed submission:
# coding: utf-8
import bisect

N = int(input())
L = sorted(list(map(int, input().split())))
ans = 0
for i in range(N):
    for j in range(i + 1, N - 1):
        ans += max(bisect.bisect_right(L, L[i] + L[j] - 1) - j - 1, 0)
print(ans)
Buggy python submission (verdict: Runtime Error):
# coding: UTF-8
N = int(input())
ans = N / (N // 2)
print(ans)

Fixed submission:
# coding: UTF-8
N = int(input())
ans = -(-N // 2) / N
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
#coding: UTF-8
N = int(input())
A = list(map(int, input().split()))
ans = []
for i in range(N):
  ans.append(A.index(i + 1) + 1)
ans = list(map(str, ans))
ans = " ".join(ans)
print(ans)

Fixed submission:
#coding: UTF-8
N = int(input())
A = list(map(int, input().split()))
ans = []
for i in range(N):
  ans.append(0)
for i in range(N):
  ans[A[i] - 1] = i + 1 
ans = list(map(str, ans))
ans = " ".join(ans)
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().split()))
ans = 0
temp = 0
l = 0
r = 0
while r < N:
  if temp ^ a[r] == temp + a[r]:
    temp += A[r]
    ans += r - l + 1
    r += 1
  else:
    temp -= A[l]
    l += 1
print(ans)

Fixed submission:
N = int(input())
a = list(map(int, input().split()))
ans = 0
temp = 0
l = 0
r = 0
while r < N:
  if temp ^ a[r] == temp + a[r]:
    temp += a[r]
    ans += r - l + 1
    r += 1
  else:
    temp -= a[l]
    l += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = list(map(int, input().split()))
ans = 0
for i in range(N):
  ans += 1
  temp = a[i]
  index = i
  while index < N - 1:
    if temp ^ a[index + 1] == temp + a[index + 1]:
      temp += a[index + 1]
      index += 1
      ans += 1
    else:
      break
print(ans)

Fixed submission:
N = int(input())
a = list(map(int, input().split()))
ans = 0
temp = 0
l = 0
r = 0
while r < N:
  if temp ^ a[r] == temp + a[r]:
    temp += a[r]
    ans += r - l + 1
    r += 1
  else:
    temp -= a[l]
    l += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
H, W = map(int, input().split())
s = []
flag = 0
ans = "No"
for i in range(W):
  s.append(list(input()))
for i in range(H):
  for j in range(W):
    if flag == 0:
      if s[i][j] == "#":
        if s[max(0, i - 1)][j] == "#" or s[i][max(0, j - 1)] == "#" or s[min(H - 1, i + 1)][j] == "#" or s[i][min(W - 1, j + 1)] == "#":
          continue
        else:
          flag += 1
if flag == 0:
  ans = "Yes"
print(ans)

Fixed submission:
import math
H, W = map(int, input().split())
s = []
flag = 0
ans = "No"
for i in range(H):
  s.append(list(input()))
for i in range(H):
  for j in range(W):
    if flag == 0:
      if s[i][j] == "#":
        if s[max(0, i - 1)][j] == "#" or s[i][max(0, j - 1)] == "#" or s[min(H - 1, i + 1)][j] == "#" or s[i][min(W - 1, j + 1)] == "#":
          continue
        else:
          flag += 1
if flag == 0:
  ans = "Yes"
print(ans)

Buggy python submission (verdict: Runtime Error):
import math
H, W = map(int, input().split())
s = []
flag = 0
ans = "No"
for i in range(W):
  s.append(list(input()))
if flag == 0:
  for i in range(H):
    for j in range(W):
      if s[i][j] == "#":
        if s[max(0, i - 1)][j] == "#" or s[i][max(0, j - 1)] == "#" or s[min(H - 1, i + 1)][j] == "#" or s[i][min(W - 1, j + 1)] == "#":
          continue
        else:
          flag += 1
if flag == 0:
  ans = "Yes"
print(ans)

Fixed submission:
import math
H, W = map(int, input().split())
s = []
flag = 0
ans = "No"
for i in range(H):
  s.append(list(input()))
for i in range(H):
  for j in range(W):
    if flag == 0:
      if s[i][j] == "#":
        if s[max(0, i - 1)][j] == "#" or s[i][max(0, j - 1)] == "#" or s[min(H - 1, i + 1)][j] == "#" or s[i][min(W - 1, j + 1)] == "#":
          continue
        else:
          flag += 1
if flag == 0:
  ans = "Yes"
print(ans)
Buggy python submission (verdict: Runtime Error):
Sprime = input() # S'の入力
T = input() # Tの入力
S = [] # Sの候補をlistで管理
if len(Sprime) < len(T): # S'の文字列長がTの文字列長よりも短い場合はそもそもSが存在しえない
    print("UNRESTORABLE")
    exit()
for i in range(len(Sprime) - len(T) + 1): # 左からTを入れられるか見ていく
    flag = 0 # 文字が一致しえないことのflagを初期化
    if Sprime[i] == T[0] or Sprime[i] == "?":
        for j in range(len(T)):
            if Sprime[i + j] != T[j] and Sprime[i + j] != "?": # 一致しえない場合
                flag += 1
                break
        if flag != 1:
            S.append(Sprime[0 : i].replace("?", "a") + T + Sprime[i + len(T) :].replace("?", "a")) # 辞書順最小を求めるので?は全てaにする
S.sort() # Sの候補をさらに辞書順に並べる
if S == []: # Sの候補が無い場合 "UNRESTORABLE" を出力
    print("UNRESTORABLE")
else: # Sの候補のうち辞書順最小のものを出力
    print(S[0])
print(S[0]) # Sの候補のうち辞書順最小のものを出力

Fixed submission:
Sprime = input() # S'の入力
T = input() # Tの入力
S = [] # Sの候補をlistで管理
if len(Sprime) < len(T): # S'の文字列長がTの文字列長よりも短い場合はそもそもSが存在しえない
    print("UNRESTORABLE")
    exit()
for i in range(len(Sprime) - len(T) + 1): # 左からTを入れられるか見ていく
    flag = 0 # 文字が一致しえないことのflagを初期化
    if Sprime[i] == T[0] or Sprime[i] == "?":
        for j in range(len(T)):
            if Sprime[i + j] != T[j] and Sprime[i + j] != "?": # 一致しえない場合
                flag += 1
                break
        if flag != 1:
            S.append(Sprime[0 : i].replace("?", "a") + T + Sprime[i + len(T) :].replace("?", "a")) # 辞書順最小を求めるので?は全てaにする
S.sort() # Sの候補をさらに辞書順に並べる
if S == []: # Sの候補が無い場合 "UNRESTORABLE" を出力
    print("UNRESTORABLE")
else: # Sの候補のうち辞書順最小のものを出力
    print(S[0])

Buggy python submission (verdict: Runtime Error):
# coding: utf-8
Sprime = input() # S'の入力
T = input() # Tの入力
S = [] # Sの候補をlistで管理
if len(Sprime) < len(T): # S'の文字列長がTの文字列長よりも短い場合はそもそもSが存在しえない
    print("UNRESTORABLE")
    exit()
for i in range(len(Sprime) - len(T) + 1): # 左からTを入れられるか見ていく
    flag = 0 # 文字が一致しえないことのflagを初期化
    if Sprime[i] == T[0] or Sprime[i] == "?":
        for j in range(len(T)):
            if Sprime[i + j] != T[j] and Sprime[i + j] != "?": # 一致しえない場合
                flag += 1
                break
        if flag != 1:
            S.append(Sprime[0 : i].replace("?", "a") + T + Sprime[i + len(T) :].replace("?", "a")) # 辞書順最小を求めるので?は全てaにする
S.sort() # Sの候補をさらに辞書順に並べる
print(S[0]) # Sの候補のうち辞書順最小のものを出力

Fixed submission:
Sprime = input() # S'の入力
T = input() # Tの入力
S = [] # Sの候補をlistで管理
if len(Sprime) < len(T): # S'の文字列長がTの文字列長よりも短い場合はそもそもSが存在しえない
    print("UNRESTORABLE")
    exit()
for i in range(len(Sprime) - len(T) + 1): # 左からTを入れられるか見ていく
    flag = 0 # 文字が一致しえないことのflagを初期化
    if Sprime[i] == T[0] or Sprime[i] == "?":
        for j in range(len(T)):
            if Sprime[i + j] != T[j] and Sprime[i + j] != "?": # 一致しえない場合
                flag += 1
                break
        if flag != 1:
            S.append(Sprime[0 : i].replace("?", "a") + T + Sprime[i + len(T) :].replace("?", "a")) # 辞書順最小を求めるので?は全てaにする
S.sort() # Sの候補をさらに辞書順に並べる
if S == []: # Sの候補が無い場合 "UNRESTORABLE" を出力
    print("UNRESTORABLE")
else: # Sの候補のうち辞書順最小のものを出力
    print(S[0])
Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
N, x = map(int, input().split())
a = list(map(int, input().split()))
ans = 0
for i in range(N - 1): # 貪欲法で解く
    while a[i] + a[i + 1] > x and a[i + 1] >= 1: # 左の組から順に、組の右側から食べていく
        ans += 1
        a[i + 1] -= 1
    while a[i] + a[i + 1] > x: # それでも足りないなら組の左側も食べる
        ans += 1
        a[i] -= 1
print(ans)

Fixed submission:
# coding: utf-8
N, x = map(int, input().split())
a = list(map(int, input().split()))
ans = 0
for i in range(N - 1): # 貪欲法で解く
    if a[i] + a[i + 1] > x and a[i + 1] >= 1: # 左の組から順に、組の右側から食べていく
        ans += min(a[i] + a[i + 1] - x, a[i + 1])
        a[i + 1] -= min(a[i] + a[i + 1] - x, a[i + 1])
    if a[i] + a[i + 1] > x: # それでも足りないなら組の左側も食べる
        ans += a[i] + a[i + 1] - x
        a[i] -= a[i] + a[i + 1] - x
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import collections

N = int(input())
S = []
for _ in range(N):
    S.append(input())
c = collections.Counter(S)
ans = []
max = c.most_common()[0][1]
i = 0
current = c.most_common()[i]
while current[1] == max:
    ans.append(current[0])
    i += 1
    if len(c) <= i:
        break
    current = c.most_common()[i]

ans.sort()
for s in ans:
    print(s)


Fixed submission:
import collections

N = int(input())
S = []
for _ in range(N):
    S.append(input())

c = collections.Counter(S)
max = c.most_common()[0][1]
ans = [i[0] for i in c.items() if i[1] == max]
ans.sort()

for s in ans:
    print(s)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = []
for _ in range(N):
    S.append(input())

S_set = set(S)
S_dict = {}
ans = []
for s in S_set:
    S_dict[s] = S.count(s)
S_dict = sorted(S_dict.items(), key=lambda x:x[1])
max = S_dict[-1][1]
while S_dict[-1][1] == max:
    ans.append(S_dict[-1][0])
    S_dict.pop(-1)
    if len(S_dict) == 0:
        break
ans.sort()

for s in ans:
    print(s)


Fixed submission:
import collections

N = int(input())
S = []
for _ in range(N):
    S.append(input())

c = collections.Counter(S)
max = c.most_common()[0][1]
ans = [i[0] for i in c.items() if i[1] == max]
ans.sort()

for s in ans:
    print(s)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N, K = [int(i) for i in input().split()]
P = [int(p) for p in input().split()]

max_P = []
max = 0
for i in range(N-K+1):
    tmp = P[i:i+K]
    sum_dice = np.sum(tmp)
    if sum_dice > max:
        max = sum_dice
        max_P = tmp

ans = np.sum((np.array(max_P)+1)/2)

print(ans)

Fixed submission:
import numpy as np

N, K = [int(i) for i in input().split()]
P = [int(p) for p in input().split()]

max = 0
sum = 0
for i in range(N):
    sum += P[i]
    if i >= K:
        sum -= P[i-K]
    if max < sum:
        max = sum
print((max+K)/2)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N, K = [int(i) for i in input().split()]
P = [int(p) for p in input().split()]

max_P = []
max = 0
for i in range(N-K+1):
    tmp = P[i:i+K]
    sum_dice = np.sum(tmp)
    if sum_dice > max:
        max = sum_dice
        max_P = tmp

ans = 0
for p in max_P:
    ans += np.sum(np.arange(1,p+1))/p

print(ans)


Fixed submission:
import numpy as np

N, K = [int(i) for i in input().split()]
P = [int(p) for p in input().split()]

max = 0
sum = 0
for i in range(N):
    sum += P[i]
    if i >= K:
        sum -= P[i-K]
    if max < sum:
        max = sum
print((max+K)/2)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N, K = [int(i) for i in input().split()]
P = [int(p) for p in input().split()]

max_P = []
max = 0
for i in range(N-K+1):
    sum_dice = np.sum(P[i:i+K])
    if sum_dice > max:
        max = sum_dice
        max_P = P[i:i+K]

ans = 0
for p in max_P:
    ans += np.sum(np.arange(1,p+1))/p

print(ans)

Fixed submission:
import numpy as np

N, K = [int(i) for i in input().split()]
P = [int(p) for p in input().split()]

max = 0
sum = 0
for i in range(N):
    sum += P[i]
    if i >= K:
        sum -= P[i-K]
    if max < sum:
        max = sum
print((max+K)/2)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N, K = [int(i) for i in input().split()]
H = [int(h) for h in input().split()]

H = np.sort(np.array(H))[::-1]
for i in range(min(K, H.shape[0])):
    H = np.delete(H, 0)

print(np.sum(H))


Fixed submission:
import numpy as np

N, K = [int(i) for i in input().split()]
H = [int(h) for h in input().split()]

H = np.sort(np.array(H))[::-1]
H = H[min(K, H.shape[0]):]

print(np.sum(H))
Buggy python submission (verdict: Runtime Error):
A, B, K = [int(i) for i in input().split()]
if K <= A:
    a = A-K
    b = B
elif A < K and K <= A+B:
    a = 0
    b = B-(K-A)
else:
    a = 0
    b = 0
print(a, b)


Fixed submission:
S, T = [str(s) for s in input().split()]

print(T+S)
Buggy python submission (verdict: Runtime Error):
A, B, K = [int(i) for i in input().split()]
if K <= A:
    a = A-K
elif A < K and K <= A+B:
    a = 0
    b = B-(K-A)
else:
    a = 0
    b = 0
print(a, b)


Fixed submission:
A, B, K = [int(i) for i in input().split()]
if K <= A:
    a = A-K
    b = B
elif A < K and K <= A+B:
    a = 0
    b = B-(K-A)
else:
    a = 0
    b = 0
print(a, b)

Buggy python submission (verdict: Runtime Error):
A, B, K = [int(i) for i in input().split()]
if K <= A:
    a -= K
elif A < K and K <= A+B:
    a = 0
    b = B-(K-A)
else:
    a = 0
    b = 0
print(a, b)


Fixed submission:
A, B, K = [int(i) for i in input().split()]
if K <= A:
    a = A-K
    b = B
elif A < K and K <= A+B:
    a = 0
    b = B-(K-A)
else:
    a = 0
    b = 0
print(a, b)
Buggy python submission (verdict: Runtime Error):
import numpy as np

A, B = [int(i) for i in input().split()]

print(np.lcm(A, B))


Fixed submission:
import fractions

A, B = [int(i) for i in input().split()]

print(int(A*B/fractions.gcd(A, B)))

Buggy python submission (verdict: Runtime Error):
import numpy as np

A, B = [int(i) for i in input().split()]

print(np.lcm(A, B))


Fixed submission:
import fractions

A, B = [int(i) for i in input().split()]

print(int(A*B/fractions.gcd(A, B)))
Buggy python submission (verdict: Time Limit Exceeded):
count = int(input())
number_li = input().split(' ')

check_2 = 0

for i in range(count):
    check = number_li[i]
    for n in range(count):
        if i == n:
            continue

        if check == number_li[n]:
            check_2 = 1
            break
    if check_2 == 1:
        break

if check_2 == 1:
    print('NO')
else:
    print('YES')

Fixed submission:
count = int(input())
number_li = input().split(' ')
number_set = set(number_li)

list_len = len(number_li)
set_len = len(number_set)

if list_len == set_len:
    print('YES')
else:
    print('NO')

Buggy python submission (verdict: Time Limit Exceeded):
count = int(input())
number_li = input().split(' ')

check = 'a'

check_3 = 0
for i in range(count):
    check_2 = 0
    for n in range(count):
        if check == number_li[i]:
            check_2 += 1    
        check = number_li[n]
    if check_2 > 1:
        check_3 = 1
        break

if check_3 == 0:
    print('YES')
else:
    print('NO')

Fixed submission:
count = int(input())
number_li = input().split(' ')
number_set = set(number_li)

list_len = len(number_li)
set_len = len(number_set)

if list_len == set_len:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
listp = tuple(map(int, input().split()))
ans = 0
for n in range(N-K+1):
    b = sum(listp[n:n+K])
    ansc = (b+K)/2
    if ansc > ans:
        ans = ansc
    else:
        pass    
print(ans)    


Fixed submission:
N, K = map(int, input().split())
listp = tuple(map(int, input().split()))
bc =sum(listp[0:K])
b = sum(listp[0:K])
for n in range(1,N-K+1):
    b = b - listp[n-1]+listp[n+K-1]
    
    if b > bc:
        bc = b
    else:
        pass    
    #print(b)    
print((bc+K)/2)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
listp = tuple(map(int, input().split()))
listans1 = []
for n in range(N-K+1):
    b = sum(listp[n:n+K])
    listans1.append(b)
#print(listans1) 
print((max(listans1)+K)/2)

Fixed submission:
N, K = map(int, input().split())
listp = tuple(map(int, input().split()))
bc =sum(listp[0:K])
b = sum(listp[0:K])
for n in range(1,N-K+1):
    b = b - listp[n-1]+listp[n+K-1]
    
    if b > bc:
        bc = b
    else:
        pass    
    #print(b)    
print((bc+K)/2)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
listp = list(map(int, input().split()))
listans1 = []
for n in range(N-K+1):
    b = sum(listp[n:n+K])
    listans1.append(b)
#print(listans1) 
print((max(listans1)+K)/2) 

Fixed submission:
N, K = map(int, input().split())
listp = tuple(map(int, input().split()))
bc =sum(listp[0:K])
b = sum(listp[0:K])
for n in range(1,N-K+1):
    b = b - listp[n-1]+listp[n+K-1]
    
    if b > bc:
        bc = b
    else:
        pass    
    #print(b)    
print((bc+K)/2)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
listp = list(map(int, input().split()))
#print(listp)
listans = []
for n in range(N):
    a = (listp[n]+1)/2
    listans.append(a)
#print(listans)   
listans1 = []
for n in range(N-K+1):
    b = sum(listans[n:n+K])
    listans1.append(b)
#print(listans1) 
print(max(listans1)) 

Fixed submission:
N, K = map(int, input().split())
listp = tuple(map(int, input().split()))
bc =sum(listp[0:K])
b = sum(listp[0:K])
for n in range(1,N-K+1):
    b = b - listp[n-1]+listp[n+K-1]
    
    if b > bc:
        bc = b
    else:
        pass    
    #print(b)    
print((bc+K)/2)
Buggy python submission (verdict: Runtime Error):
N = int(input())
lista = []
for n in range(N):
    listan = []
    an = int(input())
    for n in range(an):
        listxy = tuple(map(int, input().split()))
        listan.append(listxy)
        listset = tuple(listan)
    lista.append(listset)    
tuplea = tuple(lista)    
#print(lista)
ansfin = 0
for n in range(2**N):
    bin2 = list(bin(n))[2:]
    bin2.reverse()
    #print(bin2)
    l = len(bin2)
    rightwrong = set()
    #print(l)
    setright = set()
    for n in range(N):
        if n<l:
            #print(bin2[n])
            if bin2[n] == str(1):
                rightwrong.add((n+1, 1))
                lo = len(tuplea[n])
                for m in range(lo):
                    setright.add(tuplea[n][m])
            else:
                rightwrong.add((n+1, 0))
        else:
            rightwrong.add((n+1, 0))  
    #print('a')                     
    #print(setright)
    #print(rightwrong)
    if setright.issubset(rightwrong):
        ans = bin2.count(str(1))
        if ansfin>=ans:
            pass
        else:
            ansfin = ans
    #print(ans)    
print(ansfin)    


Fixed submission:
N = int(input())
lista = []
for n in range(N):
    listan = []
    an = int(input())
    for n in range(an):
        listxy = tuple(map(int, input().split()))
        listan.append(listxy)
    listset = tuple(listan)
    lista.append(listset)    
tuplea = tuple(lista)    
#print(lista)
ansfin = 0
for n in range(2**N):
    bin2 = list(bin(n))[2:]
    bin2.reverse()
    #print(bin2)
    l = len(bin2)
    rightwrong = set()
    #print(l)
    setright = set()
    for n in range(N):
        if n<l:
            #print(bin2[n])
            if bin2[n] == str(1):
                rightwrong.add((n+1, 1))
                lo = len(tuplea[n])
                for m in range(lo):
                    setright.add(tuplea[n][m])
            else:
                rightwrong.add((n+1, 0))
        else:
            rightwrong.add((n+1, 0))  
    #print('a')                     
    #print(setright)
    #print(rightwrong)
    if setright.issubset(rightwrong):
        ans = bin2.count(str(1))
        if ansfin>=ans:
            pass
        else:
            ansfin = ans
    #print(ans)    
print(ansfin)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
lists = input().split()
#print(lists)
ans = ''
for n in range(1,N+1):
    a = lists.index(str(n))+1
    #print(a)
    ans += str(a) + " "
print(ans)    

Fixed submission:
N = int(input())
lists = list(map(int, input().split()))
#print(lists)
ans = [0]*N
for i, order in enumerate(lists):
    ans[order-1] = i+1
print(*ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
lists = input().split()
#print(lists)
ans = ''
for n in range(1,N+1):
    a = lists.index(str(n))+1
    #print(a)
    ans = ans + str(a) + " "
print(ans)    

Fixed submission:
N = int(input())
lists = list(map(int, input().split()))
#print(lists)
ans = [0]*N
for i, order in enumerate(lists):
    ans[order-1] = i+1
print(*ans)
Buggy python submission (verdict: Time Limit Exceeded):
N, K, Q = map(int, input().split())
#print(N, K, Q)
listq = []
for i in range(Q):
    ai = int(input())
    listq.append(ai)
#print(listq)    
for n in range(N):
    num = listq.count(n+1)
    ansn = K - Q + num
    if ansn>0:
        print('Yes')
    else:
        print('No')    


Fixed submission:
N, K, Q = map(int, input().split())
#print(N, K, Q)
listq = [0]*N
for i in range(Q):
    ai = int(input())
    listq[ai-1] += 1
#print(listq)    
for n in range(N):
    num = listq[n]
    ansn = K - Q + num
    if ansn>0:
        print('Yes')
    else:
        print('No')