Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import queue
h,w = map(int,input().split())
mas = []
black_num = 0
for i in range(h):
    row = list(input())
    mas.append(row)
for i in range(h):
    for j in range(w):
        if mas[i][j] == "#":
            black_num += 1
dx = [0,0,1,-1]
dy = [1,-1,0,0]
def bfs():
    q = queue.Queue()
    q.put([0,0])
    step = mas.copy()
    for i in range(h):
        for j in range(w):
            step[i][j] = -1
    step[0][0] = 0
    while not q.empty():
        s = q.get()
        if s[0] == h-1 and s[1] == w-1:
            break
        for i in range(4):
            nx = s[0] + dx[i]
            ny = s[1] + dy[i]
            if(0 <= nx < h and 0 <= ny < w and mas[nx][ny] !="#" and step[nx][ny] == -1):
                q.put([nx,ny])
                step[nx][ny] = step[s[0]][s[1]] + 1
    return ste[h-1][w-1]

least = bfs()
if(least == -1):
    print(-1)
else:
    print(h * w - black_num - least - 1)

Fixed submission:
import queue
h,w = map(int,input().split())
mas = []
black_num = 0
inf = 10 ** 7
for i in range(h):
    row = list(input())
    mas.append(row)
for i in range(h):
    for j in range(w):
        if mas[i][j] == "#":
            black_num += 1
dx = [0,0,1,-1]
dy = [1,-1,0,0]
def bfs():
    q = []
    q.append([0,0])
    step = []
    for i in range(h):
        step.append([-1] * w)
    for i in range(h):
        for j in range(w):
            step[i][j] = inf
    step[0][0] = 0
    while not len(q) == 0:
        s = q[0]
        q = q[1:]
        if s[0] == h-1 and s[1] == w-1:
            break
        for i in range(4):
            nx = s[0] + dx[i]
            ny = s[1] + dy[i]
            if(0 <= nx < h and 0 <= ny < w and mas[nx][ny] != '#' and step[nx][ny] == inf):
                q.append([nx,ny])
                step[nx][ny] = step[s[0]][s[1]] + 1
    
    if(step[h-1][w-1] == inf):
        return -1
    else:
        return step[h-1][w-1]

least = bfs()
if(least == -1):
    print(-1)
else:
    print(h * w - black_num - least - 1)
Buggy python submission (verdict: Runtime Error):
import collections

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

import collections 
def solve():
  c = list(collections.Counter(a).values())
  c.sort()
  if(len(c)<=k):
    print(0)
  else:
    print(sum(c[:len(c)-k]))
 
solve()

Fixed submission:
n,k  =map(int, input().split())
A = list(map(int, input().split()))

d = {}
for a in A:
    d[a] = d.get(a, 0) + 1

if len(d) <= k:
    print(0)
else:
    d = sorted(d.values())
    cnt = 0
    for i in range(len(d)-k):
        cnt += d[i]
    print(cnt)

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
a = list(map(int, input().split())
import collections 
def solve():
  c = list(collections.Counter(a).values())
  c.sort()
  if(len(c)<=k):
    print(0)
  else:
    print(sum(c[:len(c)-k]))
 
solve()

Fixed submission:
n,k  =map(int, input().split())
A = list(map(int, input().split()))

d = {}
for a in A:
    d[a] = d.get(a, 0) + 1

if len(d) <= k:
    print(0)
else:
    d = sorted(d.values())
    cnt = 0
    for i in range(len(d)-k):
        cnt += d[i]
    print(cnt)
Buggy python submission (verdict: Runtime Error):
s = input()
a = int(s[0])
b = int(s[1])
c = int(s[2])
d = int(s[3])
op = ["+","-"]
def pc(x,y,op):
    if op == "+":
        return x + y
    elif op == "-":
        return x - y
li = []
ope = []
ans = 0
for i in op:
    ans = pc(a,b,i)
    for j in op:
        ans = pc(ans,c,j)
        for k in op:
            ans = pc(ans,d,k)
            li.append(ans)
            ope.append(str(a)+i+str(b)+j+str(c)+k+str(d)+"=7")
print(ope[li.index(7)])

Fixed submission:
s = input()
a = int(s[0])
b = int(s[1])
c = int(s[2])
d = int(s[3])
if a + b + c + d == 7:
    print(str(a)+"+"+str(b)+"+"+str(c)+"+"+str(d)+"=7")
elif a + b + c - d == 7:
    print(str(a)+"+"+str(b)+"+"+str(c)+"-"+str(d)+"=7")
elif a + b - c - d == 7:
    print(str(a)+"+"+str(b)+"-"+str(c)+"-"+str(d)+"=7")
elif a - b - c - d == 7:
    print(str(a)+"-"+str(b)+"-"+str(c)+"-"+str(d)+"=7")
elif a - b - c + d == 7:
    print(str(a)+"-"+str(b)+"-"+str(c)+"+"+str(d)+"=7")
elif a - b + c + d == 7:
    print(str(a)+"-"+str(b)+"+"+str(c)+"+"+str(d)+"=7")
elif a - b + c - d == 7:
    print(str(a)+"-"+str(b)+"+"+str(c)+"-"+str(d)+"=7")
else:
    print(str(a)+"+"+str(b)+"-"+str(c)+"+"+str(d)+"=7")
Buggy python submission (verdict: Runtime Error):
x,y = input().split()
li = ["A","B","C","D","E"]
nx = li.index(x)
ny = li.index(y)
if nx > ny:
    print(">")
if nx == ny:
    print("=")
else:
    print("<")

Fixed submission:
x,y = input().split()
li = ["A","B","C","D","E","F"]
nx = li.index(x)
ny = li.index(y)
if nx > ny:
    print(">")
elif nx == ny:
    print("=")
else:
    print("<")

Buggy python submission (verdict: Runtime Error):
x,y = map(int,input().split())
if x > y:
    print(">")
if x == y:
    print("=")
else:
    print("<")

Fixed submission:
x,y = input().split()
li = ["A","B","C","D","E","F"]
nx = li.index(x)
ny = li.index(y)
if nx > ny:
    print(">")
elif nx == ny:
    print("=")
else:
    print("<")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ans = 0
for i in range(1,n+1):
    if i ** 2 <= n:
        ans = i**2
print(ans)

Fixed submission:
import math
n = int(input())
m = int(math.sqrt(n))
print(m ** 2)
Buggy python submission (verdict: Runtime Error):
n = int(input())
A = [0]*(10**9+5)
for i in range(n):
    a = int(input())
    A[a-1]+=1
    A[a-1]%=2
print(sum(A))


Fixed submission:
n = int(input())
A = {}
for i in range(n):
    a = int(input())
    A[a] = A.get(a, 0)+1
    A[a] %= 2
s = 0
for v in A.values():
    s += v
print(s)

Buggy python submission (verdict: Runtime Error):
n = int(input())
A = [0]*(10**9+5)
for i in range(n):
    a = int(input())
    A[a]+=1
    A[a]%=2
print(sum(A))


Fixed submission:
n = int(input())
A = {}
for i in range(n):
    a = int(input())
    A[a] = A.get(a, 0)+1
    A[a] %= 2
s = 0
for v in A.values():
    s += v
print(s)

Buggy python submission (verdict: Runtime Error):
n = int(input())
A = [0]*(10**5+5)
for i in range(n):
    a = int(input())
    A[a-1]+=1
    A[a-1]%=2
print(sum(A))


Fixed submission:
n = int(input())
A = {}
for i in range(n):
    a = int(input())
    A[a] = A.get(a, 0)+1
    A[a] %= 2
s = 0
for v in A.values():
    s += v
print(s)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
a = []
b = []
fl = False
for i in range(n):
    a.append(list(input()))
for i in range(m):
    b.append(list(input()))
for i in range(n - m + 1):
    if b[0] in a[i]:
        tmp = a[i].find(b[0])
        if m == 1:
            fl = True
        for j in range(1,m):
            if a[i+j][tmp:tmp+m] != b[j]:
                fl = False
                break
            fl = True
    if fl:
        break
        if fl:
    print("Yes")
else:
    print("No")

Fixed submission:
n,m = map(int,input().split())
a = [input() for _ in range(n)]
b = [input() for _ in range(m)]
fl = False
for i in range(n - m + 1):
    if b[0] in a[i]:
        tmp = a[i].find(b[0])
        if m == 1:
            fl = True
        for j in range(1,m):
            if a[i+j][tmp:tmp+m] != b[j]:
                fl = False
                break
            fl = True
    if fl:
        break
if fl:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
k,s = map(int,input().split())
ans = 0
for x in range(k+1):
    for y in range(k+1):
        for z in range(k+1):
            if x + y + z == s:
                ans += 1
print(ans)

Fixed submission:
k,s = map(int,input().split())
ans = 0
for x in range(k+1):
    for y in range(k+1):
        if 0 <= s - x - y <= k:
                ans += 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
a,b,x = map(int,input().split())
ans = 0
for i in range(a,b+1):
    if i % x == 0:
        ans += 1
print(ans)

Fixed submission:
a,b,x = map(int,input().split())
if a % x == 0:
    print(b // x - a // x + 1)
else:
    print(b // x - a // x)
Buggy python submission (verdict: Runtime Error):
import sys

stdin = sys.stdin
ns = lambda: stdin.readline().rstrip()
na = lambda: list(map(int, stdin.readline().split()))
ni = lambda: int(ns())

(n,u,v)=na()
u -= 1
v -= 1

g = [[] for _ in range(n)]

for i in range(0, n-1):
    (a, b) = na()
    g[a-1].append(b-1)
    g[b-1].append(a-1)


dep1 = [0] * n
dep2 = [0] * n
def dfs(now, pre, d, dep):
    dep[now] = d
    for nex in g[now]:
        if pre == nex:
            continue
        dfs(nex,now,d+1,dep)


dfs(u, -1, 0, dep1)
dfs(v, -1, 0, dep2)

ret = 0
for i in range(n):
    if dep1[i] < dep2[i]:
        ret = max(ret, dep2[i]-1)
print(ret)


Fixed submission:
import sys

stdin = sys.stdin
ns = lambda: stdin.readline().rstrip()
na = lambda: list(map(int, stdin.readline().split()))
ni = lambda: int(ns())
sys.setrecursionlimit(200000)

(n,u,v)=na()
u -= 1
v -= 1

g = [[] for _ in range(n)]

for i in range(0, n-1):
    (a, b) = na()
    g[a-1].append(b-1)
    g[b-1].append(a-1)


dep1 = [0] * n
dep2 = [0] * n
def dfs(now, pre, d, dep):
    dep[now] = d
    for nex in g[now]:
        if pre == nex:
            continue
        dfs(nex,now,d+1,dep)


dfs(u, -1, 0, dep1)
dfs(v, -1, 0, dep2)

ret = 0
for i in range(n):
    if dep1[i] < dep2[i]:
        ret = max(ret, dep2[i]-1)
print(ret)

Buggy python submission (verdict: Runtime Error):
import sys

stdin = sys.stdin
ns = lambda: stdin.readline().rstrip()
na = lambda: list(map(int, stdin.readline().split()))
ni = lambda: int(ns())

(n,u,v)=na()
u -= 1
v -= 1

g = [[] for _ in range(n)]

for i in range(0, n-1):
    (a, b) = na()
    g[a-1].append(b-1)
    g[b-1].append(a-1)


dep1 = [0] * n
dep2 = [0] * n
def dfs(now, pre, d, dep):
    dep[now] = d
    for nex in g[now]:
        if pre == nex:
            continue
        dfs(nex,now,d+1,dep)


dfs(u, -1, 0, dep1)
dfs(v, -1, 0, dep2)

ret = 0
for i in range(n):
    if dep1[i] < dep2[i]:
        ret = max(ret, dep2[i]-1)
print(ret)


Fixed submission:
import sys

stdin = sys.stdin
ns = lambda: stdin.readline().rstrip()
na = lambda: list(map(int, stdin.readline().split()))
ni = lambda: int(ns())
sys.setrecursionlimit(200000)

(n,u,v)=na()
u -= 1
v -= 1

g = [[] for _ in range(n)]

for i in range(0, n-1):
    (a, b) = na()
    g[a-1].append(b-1)
    g[b-1].append(a-1)


dep1 = [0] * n
dep2 = [0] * n
def dfs(now, pre, d, dep):
    dep[now] = d
    for nex in g[now]:
        if pre == nex:
            continue
        dfs(nex,now,d+1,dep)


dfs(u, -1, 0, dep1)
dfs(v, -1, 0, dep2)

ret = 0
for i in range(n):
    if dep1[i] < dep2[i]:
        ret = max(ret, dep2[i]-1)
print(ret)
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
#Union-Find木
#par[i]:iの親　deep[i]:iの深さ　size[i]:iの大きさ
par=[i for i in range(n)]
deep=[1]*n
size=[1]*n

#親を見つける
def find(x):
  if par[x]==x:
    return x
  else:
    return find(par[x])

#二つのグループを統合する
def unite(x,y):
  x=find(x)
  y=find(y)
  if x==y:
    return
  if deep[x]<deep[y]:
    par[x]=y
    size[y]+=size[x]
  else:
    par[y]=x
    size[x]+=size[y]
    if deep[x]==deep[y]:
      deep[x]+=1

#xとyが同じグループに属するかどうか
def same(x,y):
  return find(x)==find(y)

#xが属するグループの要素数を返す
def group_count(x):
  return size[find(x)]

#連結成分の個数を返す
def count():
  check=set()
  for i in par:
    parent=find(i)
    if parent not in check:
      check.add(parent)
  return len(check)

for i in range(m):
  a,b=map(int,input().split())
  unite(a,b)
print(count()-1)
    
  


Fixed submission:
n,m=map(int,input().split())

#Union-Find木
#par[i]:iの親　deep[i]:iの深さ　size[i]:iの大きさ
par=[i for i in range(n)]
deep=[1]*n
size=[1]*n

#親を見つける
def find(x):
  if par[x]==x:
    return x
  else:
    return find(par[x])

#二つのグループを統合する
def unite(x,y):
  x=find(x)
  y=find(y)
  if x==y:
    return
  if deep[x]<deep[y]:
    par[x]=y
    size[y]+=size[x]
  else:
    par[y]=x
    size[x]+=size[y]
    if deep[x]==deep[y]:
      deep[x]+=1

#xとyが同じグループに属するかどうか
def same(x,y):
  return find(x)==find(y)

#xが属するグループの要素数を返す
def group_count(x):
  return size[find(x)]
  
for i in range(m):
  a,b=map(int,input().split())
  unite(a-1,b-1)
  
from collections import Counter
x=[]
for i in par:
  x.append(find(i))
x=Counter(x)
print(len(x)-1)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))

import sys
import math
def setwise_coprime(a):
  ans=a[0]
  for i in range(1,n):
    ans=math.gcd(ans,a[i])
  return ans

#エラストテネスのふるい
def create_sieve(n):
  sieve=[0]*(n+1)
  for i in range(2,n+1):
    if sieve[i]==0:
      for j in range(i*i,n+1,i):
        sieve[j]=i
  return sieve

#高速素因数分解
def fast_factorization(n, sieve):
  prime={}
  while n>1:
    p=sieve[n]
    #nが素数の場合
    if p==0:
      prime[n]=prime.get(n,0)+1
      break
    #nが素数ではない場合
    else:
      prime[p]=prime.get(p,0)+1
      n=n//p
  return prime

check=set()
if setwise_coprime(a)==1:
  #素因数のダブリをcheck
  sieve=create_sieve(10**6)
  for i in range(n):
    if a[i]!=1:
      s=fast_factorization(a[i], sieve)
      for i in s:
        if i in check:
          print("setwise coprime")
          sys.exit()
        else:
          check.add(i)
  print("pairwise coprime")    
else:
  print("not coprime")
  
  



      
      
    


Fixed submission:
d,t,s=map(int,input().split())
if s*t>=d:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
#最大の最小値を求める問題は二部探索
#最大の最小値がちょうどokとngの境界になる
#求める値をlとするとその長さに全ての丸太をきるのに必要な回数を数えることができる
#その丸太をきる回数がk回以下であればいい
#絶対にだめ→０　絶対にオッケー→max(a)
n,k=list(map(int,input().split()))
a=list(map(int,input().split()))
#丸太をきる回数がk回以下かどうか調べる関数
def check(n):
  cnt=0
  for l in a:
    if l%n==0:
      cnt=cnt+l//n-1
    else:
      cnt=cnt+l//n
  if cnt<=k:
    return True
  else:
    return False
#二部探索  
left=-1
right=max(a)+1
while right-left>1:
  mid=(right+left)//2
  if check(mid):
    right=mid
  else:
    left=mid
print(right)
  


Fixed submission:
#最大の最小値を求める問題は二部探索
#最大の最小値がちょうどokとngの境界になる
#求める値をlとするとその長さに全ての丸太をきるのに必要な回数を数えることができる
#その丸太をきる回数がk回以下であればいい
#絶対にだめ→０　絶対にオッケー→max(a)
n,k=list(map(int,input().split()))
a=list(map(int,input().split()))
#丸太をきる回数がk回以下かどうか調べる関数
def check(n):
  cnt=0
  for l in a:
    if l%n==0:
      cnt=cnt+l//n-1
    else:
      cnt=cnt+l//n
  if cnt<=k:
    return True
  else:
    return False
#二部探索  
left=0
right=max(a)
while right-left>1:
  mid=(right+left)//2
  if check(mid):
    right=mid
  else:
    left=mid
print(right)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)
ans=a[0]
dp=[]
dp.append(a[0])
dp.append(a[1])
for i in range(2,n):
  check=0
  for j in range(i-1):
    check=max(check,min(dp[j],dp[j+1]))
  dp.insert(dp.index(check),a[i])
  ans=ans+check
print(ans)

  



Fixed submission:
n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)
if n%2==0:
  print(a[0]+sum(a[1:int(n/2)])*2)
else:
  print(a[0]+sum(a[1:int((n-1)/2)])*2+a[int((n+1)/2-1)])
Buggy python submission (verdict: Time Limit Exceeded):
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]
  
a=int(input())
ans=0
for i in range(1,a+1):
  ans=ans+i*len(make_divisors(i))
print(ans)


Fixed submission:
n=int(input())
ans=0

for i in range(1,n+1):
  k=n//i
  ans=ans+i*k*(k+1)//2

print(ans)
Buggy python submission (verdict: Runtime Error):
from decimal import Decimal
a,b=list(map(decimal,input().split()))
print(int(a*b))


Fixed submission:
from decimal import Decimal
a,b=list(map(Decimal,input().split()))
print(int(a*b))

Buggy python submission (verdict: Runtime Error):
n=int(input())
A=list(map(int,input().split()))
from collections import deque
q=deque(A)
 
ans=1
while len(q)>0:
    p=q.popleft()
    ans=ans*p
if ans>1000000000000000000:
    print(-1)
else:
    print(ans)

Fixed submission:
from decimal import Decimal
a,b=list(map(Decimal,input().split()))
print(int(a*b))
Buggy python submission (verdict: Runtime Error):
a,b=list(map(float,input().split()))
c=a*(b*100)
d=int(c//100)
print(d)

Fixed submission:
import collections
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
 
n=int(input())
c= collections.Counter(prime_factorize(n))
#ここまでで素因数分解して個数が何個あるかcheckしてる
sum=0
for i in c:
    n=1
    while n*(n+1)/2<=c[i]:
        n=n+1
    sum=sum+n-1
print(sum)
Buggy python submission (verdict: Runtime Error):
n,k=list(map(int,input().split()))
A=[i for i in range(1,n+1)]
B=list(map(int,input().split())) 
road=dict(zip(A,B))

#残りi回移動する、移動前に自分がいるところをj
def walk(i,j):
    if i==1:
        return road[j]
    else:
        return walk(i-1,road[j])

print(walk(k,1))

Fixed submission:
n,k=list(map(int,input().split()))
A=[i for i in range(1,n+1)]
B=list(map(int,input().split())) 
road=dict(zip(A,B))

#残りi回移動する、移動前に自分がいるところをj
#def walk(i,j):
#        return road[j]
#    else:
#        return walk(i-1,road[j])

j=1
C=[-1 for i in range(n)]
dp=dict(zip(A,C))
dp[1]=0
num=0
while dp[j]!=k-1:
    j=road[j]
    num=num+1
    if dp[j]== -1:
        dp[j]=num
    else:
        t=num-dp[j]
        pre=dp[j]
        itti=j
        break
    if num==k-1:
        print(road[j])
        exit()

mod=(k-pre)%t

for i in range(mod):
    itti=road[itti]
print(itti)
Buggy python submission (verdict: Runtime Error):
n=int(input())
A=list(map(int,input().split()))
L=[]
R=[]
for i in range(n):
  L.append(i+A[i])
  R.append(i-A[i])
from collections import Counter
zisyo=R.Counter(R)
ans=0
for i in L:
  ans=ans+get(i,0)
print(ans)
  


Fixed submission:
n=int(input())
A=list(map(int,input().split()))
L=[]
R=[]
for i in range(n):
  L.append(i+A[i])
  R.append(i-A[i])
from collections import Counter
zisyo=Counter(R)
ans=0
for i in L:
  ans=ans+zisyo.get(i,0)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
L=[i+A[i] for i in range(N)]
R=[i-A[i] for i in range(N)]
sum=0
for i in L:
  sum=sum+R.count(i)
print(sum)

Fixed submission:
n=int(input())
A=list(map(int,input().split()))
L=[]
R=[]
for i in range(n):
  L.append(i+A[i])
  R.append(i-A[i])
from collections import Counter
zisyo=Counter(R)
ans=0
for i in L:
  ans=ans+zisyo.get(i,0)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
sum=0
for i in range(N-1):
  for j in range(i+1,N):
    if j-i==A[i]+A[j]:
      sum=sum+1
print(sum)
    
  

Fixed submission:
n=int(input())
A=list(map(int,input().split()))
L=[]
R=[]
for i in range(n):
  L.append(i+A[i])
  R.append(i-A[i])
from collections import Counter
zisyo=Counter(R)
ans=0
for i in L:
  ans=ans+zisyo.get(i,0)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
sum=0
for i in range(N-1):
  for j in range(i+1,N):
    if j-i==A[i]+A[j]:
      sum=sum+1
print(sum)
    
  

Fixed submission:
n=int(input())
A=list(map(int,input().split()))
L=[]
R=[]
for i in range(n):
  L.append(i+A[i])
  R.append(i-A[i])
from collections import Counter
zisyo=Counter(R)
ans=0
for i in L:
  ans=ans+zisyo.get(i,0)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
list=[]
for i in range(n):
  a=input()
  if a not in list:
    list.append(a)
print(len(list))



Fixed submission:
from collections import Counter
n=int(input())
list=[]
for i in range(n):
  list.append(input())
a=Counter(list)
print(len(a))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
list=[]
for i in range(n):
  a=input()
  if a not in list:
    list.append(a)
print(len(list))



Fixed submission:
from collections import Counter
n=int(input())
list=[]
for i in range(n):
  list.append(input())
a=Counter(list)
print(len(a))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
list=[]
for i in range(n):
  list.append(input())
s=[]
for i in range(n):
  if list[i] not in s:
    s.append(list[i])
print(len(s))



Fixed submission:
from collections import Counter
n=int(input())
list=[]
for i in range(n):
  list.append(input())
a=Counter(list)
print(len(a))
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
t=[0 for i in range(n)]
for i in a:
  b=a[i]
  t[b-1]=t[b-1]+1
for j in range(n):
  print(t[j])

Fixed submission:
n=int(input())
a=list(map(int,input().split(" ")))
t=[0 for i in range(n)]
for i in range(n-1):
  b=a[i]
  t[b-1]=t[b-1]+1
for j in range(n):
  print(t[j])

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
t=[0 for i in range(n)]
for i in a:
  b=a[i]
  t[b-1]=t[b-1]+1
for j in range(n):
  print(t[j])

Fixed submission:
n=int(input())
a=list(map(int,input().split(" ")))
t=[0 for i in range(n)]
for i in range(n-1):
  b=a[i]
  t[b-1]=t[b-1]+1
for j in range(n):
  print(t[j])

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split(" "))
list=[0 for i in range(n)]
for i in a:
  b=a[i]
  list[b]=list[b]+1
for j in list:
  print(list[j])

Fixed submission:
n=int(input())
a=list(map(int,input().split(" ")))
t=[0 for i in range(n)]
for i in range(n-1):
  b=a[i]
  t[b-1]=t[b-1]+1
for j in range(n):
  print(t[j])

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(input())
a.sort()
for i in range(n):
  print(a.count(str(i+1)))




Fixed submission:
n=int(input())
a=list(map(int,input().split(" ")))
t=[0 for i in range(n)]
for i in range(n-1):
  b=a[i]
  t[b-1]=t[b-1]+1
for j in range(n):
  print(t[j])

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=input()
for i in range(n):
  print(a.count(str(i+1),i,))





Fixed submission:
n=int(input())
a=list(map(int,input().split(" ")))
t=[0 for i in range(n)]
for i in range(n-1):
  b=a[i]
  t[b-1]=t[b-1]+1
for j in range(n):
  print(t[j])

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=input()
for i in range(n):
  print(a.count(str(i+1),i,))





Fixed submission:
n=int(input())
a=list(map(int,input().split(" ")))
t=[0 for i in range(n)]
for i in range(n-1):
  b=a[i]
  t[b-1]=t[b-1]+1
for j in range(n):
  print(t[j])
Buggy python submission (verdict: Runtime Error):
a=list(map(int,input().split(" ")))
n=a[0]
m=a[1]
touhyou=list(map(int,input().split(" ")))
s=flaot(sum(touhyou)/4/m)
list=[]
for i in touhyou:
  if i>=s:
    list.append(i)
if len(list)>=m:
  print("Yes")
else:
  print("No" )

Fixed submission:
a=list(input().split(" "))
print(a[2]+" "+a[0]+" "+a[1] )
Buggy python submission (verdict: Runtime Error):
a=list(map(int,input().split(" ")))
n=a[0]
m=a[1]
touhyou=list(map(int,input().split(" ")))
s=flaot(sum(touhyou)/4/m)
list=[]
for i in touhyou:
  if i>=s:
    list.append(i)
if len(list)>=m:
  print("Yes")
else:
  print("No" )
a=list(map(int,input().split(" ")))
n=a[0]
m=a[1]
touhyou=list(map(int,input().split(" ")))
s=flaot(sum(touhyou)/4/m)
list=[]
for i in touhyou:
  if i>=s:
    list.append(i)
if len(list)>=m:
  print("Yes")
else:
  print("No" )


Fixed submission:
a=list(map(int,input().split()))
n=a[0]
m=a[1]
touhyou=list(map(int,input().split()))
s=float(sum(touhyou)/4/m)
list=[]
for i in touhyou:
  if i>=s:
    list.append(i)
if len(list)>=m:
  print("Yes")
else:
  print("No" )