Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
sal
n = int(input())
l = list(map(int,input().split()))
r = [0]*n
for i in range(n):
  r[l[i]-1] = i+1
for x in r:
  print(x)


Fixed submission:
a=int(input())
b=[0]*a
c=list(map(int,input().split()))

for i in range(a):
  b[c[i]-1]+=i+1
print(' '.join(map(str, b)))

Buggy python submission (verdict: Runtime Error):
n=int(input())
a= list(map(int, input().split())) 
p=[0]*n

for i in range(n):
  p[a[i]]=i+1
  print(p[i],end=" ")


Fixed submission:
a=int(input())
b=[0]*a
c=list(map(int,input().split()))

for i in range(a):
  b[c[i]-1]+=i+1
print(' '.join(map(str, b)))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a= list(map(int, input().split())) 


for i in range(n):
  print(1+a.index(i+1),end=" ")


Fixed submission:
a=int(input())
b=[0]*a
c=list(map(int,input().split()))

for i in range(a):
  b[c[i]-1]+=i+1
print(' '.join(map(str, b)))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a= list(map(int, input().split())) 


for i in range(len(a)):
  print(1+a.index(i+1),end=" ")


Fixed submission:
a=int(input())
b=[0]*a
c=list(map(int,input().split()))

for i in range(a):
  b[c[i]-1]+=i+1
print(' '.join(map(str, b)))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a= list(map(int, input().split())) 


for i in range(len(a)):
  print(1+a.index(i+1),end=" ")


Fixed submission:
a=int(input())
b=[0]*a
c=list(map(int,input().split()))

for i in range(a):
  b[c[i]-1]+=i+1
print(' '.join(map(str, b)))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a= list(map(int, input().split())) 
#a.sort()
#print(a)
#print(sum(a[:-1])+a[-1]//2)
b=sorted(a)
for i in range(len(a)):
  print(a.index(b[i])+1,end=" ")

Fixed submission:
a=int(input())
b=[0]*a
c=list(map(int,input().split()))

for i in range(a):
  b[c[i]-1]+=i+1
print(' '.join(map(str, b)))
Buggy python submission (verdict: Runtime Error):
s=input()

a="Sunny"
b="Rainy"
c="Cloudy"

if s=a:
  print(c)
elif s=b:
  print(a)
else:
  print(b)

Fixed submission:
s=input()

a="Sunny"
b="Rainy"
c="Cloudy"

if s==a:
  print(c)
elif s==b:
  print(a)
else:
  print(b)
Buggy python submission (verdict: Runtime Error):
n=int(input())
h = list(map(int, input().split()))
move=0
maxmove=0
minheight=h[0]

for i in range(1,n):
  if minheight>=h[i]:
    move+=1
  else:
    move=0
  minheight=h[i]
  ans=max(maxmove,move)
print(ans)
    

Fixed submission:
n=int(input())
h = list(map(int, input().split()))
move=0
maxmove=0
minheight=h[0]

for i in range(1,n):
  if minheight>=h[i]:
    move+=1
    minheight=h[i]
  else:
    maxmove=max(move,maxmove)
    move=0
    minheight=h[i]
print(max(maxmove,move))
Buggy python submission (verdict: Runtime Error):
Lily
from collections import defaultdict

n = int(input())
dct = defaultdict(int)

for i in range(n):
    s = input()
    sorted_s = "".join(sorted(s))
    dct[sorted_s] += 1

ans = 0
for k, v in dct.items():
    ans += v * (v - 1) // 2

print(ans)


Fixed submission:
n=int(input())
d=dict()

for i in range(n):
  s="".join(sorted(input()))
  #print(s)
  if s in d:
    d[s]+=1
  else:
    d[s]=1
ans=0
for x in d.values():
  ans+=x*(x-1)//2
print(ans)
Buggy python submission (verdict: Runtime Error):
yandy
N, D = map(int, input().split())
array = []
for _ in range(N):
    array.append([int(i) for i in input().split()])
 
ans = 0
for i in range(N):
    for j in range(i+1, N):
        s = 0
        for d in range(D):
            s += (array[i][d]-array[j][d]) ** 2
        if s ** (1/2) % 1 == 0:
            ans += 1
 
print(ans)

Fixed submission:
N, D = map(int, input().split())
l = [list(map(int, input().split())) for i in range(N)]

ans=0
s=0
for i in range(N):
  for j in range(i+1,N):
    s=0
    for d in range(D):
      s+=(l[i][d]-l[j][d])**2
    if s**(1/2)%1==0:
      ans+=1
print(ans)

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


Fixed submission:
N, D = map(int, input().split())
l = [list(map(int, input().split())) for i in range(N)]

ans=0
s=0
for i in range(N):
  for j in range(i+1,N):
    s=0
    for d in range(D):
      s+=(l[i][d]-l[j][d])**2
    if s**(1/2)%1==0:
      ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
salmonize
n = int(input())
l = []
for i in range(1,n+1):
  s,p = input().split()
  l.append((s,-int(p),i))
l.sort()
for x in l:
  print(x[2])


Fixed submission:
N = int(input())
l = []

for i in range(N):
  s,p=input().split()
  p=100-int(p)
  l.append((s,p,i+1))
l.sort()
for i in range(N):
  print(l[i][2])
Buggy python submission (verdict: Runtime Error):
s=input()
a=int(s[:2])
b=int(s[2:])
if a==0:
  if 1<=b<=12:
    print("MMYY")
  else:
    print("NA")
elif 1<=a<=12:
  if 1<=b<=12:
    print("AMBIGUOUS")
  else:
    print("NA")
else:
    if 1<=b<=12:
    print("YYMM")
  else:
    print("NA")

Fixed submission:
s=input()
a=int(s[:2])
b=int(s[2:])
if a==0:
  if 1<=b<=12:
    print("YYMM")
  else:
    print("NA")
elif 1<=a<=12:
  if 1<=b<=12:
    print("AMBIGUOUS")
  else:
    print("MMYY")
else:
    if 1<=b<=12:
      print("YYMM")
    else:
      print("NA")
Buggy python submission (verdict: Runtime Error):
#salmonize の文
n,k = map(int,input().split()) 
 #複数文字の入力
ans = 0

for i in range(1,n+1):
j=0 
  #カウンター設置
  while i<k:
    i*=2
    j+=1
  ans=1/2**j
print("{:.12}".format(ans/n))

Fixed submission:
n,k = map(int,input().split()) 
 #複数文字の入力
ans = 0

for i in range(1,n+1):
  j=0 
  #カウンター設置
  while i<k:
    i*=2
    j+=1
  ans+=1/2**j
print("{:.12}".format(ans/n))

Buggy python submission (verdict: Time Limit Exceeded):
#salmonize の文
n,k = map(int,input().split()) 
 #複数文字の入力
ans = 0     
for i in range(n+1):
  j=0
  #カウンター設置
  while i<k:
    i*=2
    j+=1
  ans=1/2**j
print("{:.12}".format(ans/n))

Fixed submission:
n,k = map(int,input().split()) 
 #複数文字の入力
ans = 0

for i in range(1,n+1):
  j=0 
  #カウンター設置
  while i<k:
    i*=2
    j+=1
  ans+=1/2**j
print("{:.12}".format(ans/n))

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split()) 
 #複数文字の入力
ans = 0     
for i in range(n+1):
  j=0
  #カウンター設置
  while i<k:
    i*=2
    j+=1
  ans=1/2**j
print(ans/n)

Fixed submission:
n,k = map(int,input().split()) 
 #複数文字の入力
ans = 0

for i in range(1,n+1):
  j=0 
  #カウンター設置
  while i<k:
    i*=2
    j+=1
  ans+=1/2**j
print("{:.12}".format(ans/n))

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split()) 
 #複数文字の入力
ans = 0     
for i in range(n+1):
  j=0
  #カウンター設置
  while i<k:
    i*=2
    j+=1
  ans=1/2**j
print(ans/n)

Fixed submission:
n,k = map(int,input().split()) 
 #複数文字の入力
ans = 0

for i in range(1,n+1):
  j=0 
  #カウンター設置
  while i<k:
    i*=2
    j+=1
  ans+=1/2**j
print("{:.12}".format(ans/n))
Buggy python submission (verdict: Runtime Error):
N, M = list(map(int, input().split()))
data = [list(map(int, input().split())) for _ in range(N)]
data.sort()

honsu=0
cost=0
for i in range(N):
  honsu+=data[i][1]
  cost+=data[i][0]*data[i][1]
 
  if honsu>M:
    ans=cost-((honsu-M)*data[i][0])
print(ans)


Fixed submission:
N, M = list(map(int, input().split()))
data = [list(map(int, input().split())) for _ in range(N)]
data.sort()

honsu=0
cost=0
for i in range(N):
  honsu+=data[i][1]
  cost+=data[i][0]*data[i][1]
 
  if honsu>M:
    cost=cost-((honsu-M)*data[i][0])
    print(cost)
    exit()
print(cost)

Buggy python submission (verdict: Runtime Error):
N, M = list(map(int, input().split()))
data = [list(map(int, input().split())) for _ in range(N)]
data.sort()

honsu=0
cost=0
for i in range(N):
  honsu+=data[i][1]
  cost+=data[i][0]*data[i][1]
 
  if honsu>M:
    ans=cost-((honsu-M)*data[i][0])
print(ans)

Fixed submission:
N, M = list(map(int, input().split()))
data = [list(map(int, input().split())) for _ in range(N)]
data.sort()

honsu=0
cost=0
for i in range(N):
  honsu+=data[i][1]
  cost+=data[i][0]*data[i][1]
 
  if honsu>M:
    cost=cost-((honsu-M)*data[i][0])
    print(cost)
    exit()
print(cost)

Buggy python submission (verdict: Runtime Error):
satoooh
, M = map(int, input().split())
A, B = [0] * N, [0] * N
for i in range(N):
	A[i], B[i] = map(int, input().split())

#  値段Aの昇順でソート
C = sorted(zip(A, B))
A, B = zip(*C)

ans, cnt, i = 0, 0, 0
while cnt < M:
	tmp = min(B[i], M - cnt)
	cnt += tmp
	ans += A[i] * tmp
	i += 1
print(ans)


Fixed submission:
N, M = list(map(int, input().split()))
data = [list(map(int, input().split())) for _ in range(N)]
data.sort()

honsu=0
cost=0
for i in range(N):
  honsu+=data[i][1]
  cost+=data[i][0]*data[i][1]
 
  if honsu>M:
    cost=cost-((honsu-M)*data[i][0])
    print(cost)
    exit()
print(cost)

Buggy python submission (verdict: Runtime Error):
yandy
N, M = list(map(int, input().split()))
data = [list(map(int, input().split())) for _ in range(N)]

data.sort()

price = 0
for d in data:
    price += d[0] * min(M, d[1])
    M -= d[1]
    if M <= 0:
        break
print(price)


Fixed submission:
N, M = list(map(int, input().split()))
data = [list(map(int, input().split())) for _ in range(N)]
data.sort()

honsu=0
cost=0
for i in range(N):
  honsu+=data[i][1]
  cost+=data[i][0]*data[i][1]
 
  if honsu>M:
    cost=cost-((honsu-M)*data[i][0])
    print(cost)
    exit()
print(cost)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = [list(map(int, input().split())) for i in range(n)]
for i in a:
    i.pop(0)
for i in range(n-1):
    a[i+1] = set(a[i]) & set(a[i+1])
print(len(a[n-1]))
salmo

Fixed submission:
N, M = map(int, input().split())
c = [0] * M
for i in range(N):
    a = [int(i) for i in input().split()]

    for j in a[1:]:
        c[j-1] += 1
 
print(c.count(N))

Buggy python submission (verdict: Runtime Error):
yandy
N, M = map(int, input().split())
c = [0] * M
for i in range(N):
    a = [int(i) for i in input().split()]
    for j in a[1:]:
        c[j-1] += 1

print(c.count(N))

n, m = map(int, input().split())
a = [list(map(int, input().split())) for i in range(n)]
for i in a:
    i.pop(0)
for i in range(n-1):
    a[i+1] = set(a[i]) & set(a[i+1])
print(len(a[n-1]))

Fixed submission:
N, M = map(int, input().split())
c = [0] * M
for i in range(N):
    a = [int(i) for i in input().split()]

    for j in a[1:]:
        c[j-1] += 1
 
print(c.count(N))
Buggy python submission (verdict: Runtime Error):
a=list(map(int,input().split()))
a,sort()
if a==[1,4,7,9] :
  print("YES")
else:
  print("NO")

Fixed submission:
a=list(map(int,input().split()))
a.sort()
if a==[1,4,7,9] :
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
sal
x1, y1, x2, y2 = map(int, input().split())
x3 = x2 + y1 - y2
y3 = y2 + x2 - x1
x4 = x3 + y2 - y3
y4 = y3 + x3 - x2
print(x3, y3, x4, y4)


Fixed submission:
x1,y1,x2,y2= map(int,input().split())
a=x2-x1
b=y2-y1

x3=x2-b
y3=y2+a

x4=x3-a
y4=y3-b

print(x3,y3,x4,y4)
Buggy python submission (verdict: Runtime Error):
satooh
H, W = map(int, input().split())
a = [list(input()) for _ in range(H)]
a = [i for i in a if "#" in "".join(i)]
# print("step1", a)
a = list(zip(*a))
# print("step2", a)
a = [j for j in a if "#" in "".join(j)]
# print("step3", a)
a = list(zip(*a))
# print("step4", a)
for n in range(len(a)):
	print("".join(a[n]))


Fixed submission:
h,w=map(int,input().split())
a=[]
for i in range(h):
    j=list(input())
    if '#' in j:
        a.append(j)
aa=zip(*[i for i in zip(*a) if '#' in i])
for i in aa:
    print(''.join(i))

Buggy python submission (verdict: Runtime Error):
salmo
h, w = map(int, input().split())
a = [list(input()) for i in range(h)]
for i in range(h):
    if set(a[h-i-1]) == {'.'}:
        del(a[h-i-1])
for i in range(w):
    if set([j[w-i-1] for j in a]) == {"."}:
        for j in a:
            del(j[w-i-1])
for i in a:
    print(''.join(i))

Fixed submission:
h,w=map(int,input().split())
a=[]
for i in range(h):
    j=list(input())
    if '#' in j:
        a.append(j)
aa=zip(*[i for i in zip(*a) if '#' in i])
for i in aa:
    print(''.join(i))
Buggy python submission (verdict: Runtime Error):
hg
n = int(input())

ans = 0
for i in range(n+1):
    count = 0
    for j in range(1,i+1):
        if i%j == 0:
            count+=1
    if count==8 and i%2 == 1:
        ans += 1
print(ans)


Fixed submission:
n=int(input())
ans=0
for i in range(1,n+1):
  count=0
  for j in range(1,i+1):
    if i%j==0:
      count+=1
  if count==8 and i%2==1:
    ans+=1
print(ans)

Buggy python submission (verdict: Runtime Error):
yandy
N = int(input())

count = [0] * 201
count[105] = 1
for i in range(105, 201):
    if i % 2 == 1:
        num = 0
        for n in range(1, i+1):
            if i % n == 0:
                num += 1
        if num == 8:
            count[i] = count[i-1]+1
        else:
            count[i] = count[i-1]
    else:
        count[i] = count[i-1]

print(count[N])


Fixed submission:
n=int(input())
ans=0
for i in range(1,n+1):
  count=0
  for j in range(1,i+1):
    if i%j==0:
      count+=1
  if count==8 and i%2==1:
    ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
yandy
S = input()

if S[0] == 'A' and S[2:-1].count('C') == 1:
    c = S.index('C')
    if S[1:c].islower() and S[c+1:].islower():
        print('AC')
        exit()


print('WA')


Fixed submission:
s = input()

if s[0]=="A" and s[2:-1].count("C")==1 and s[1:].replace("C","a",1).islower()==True:
  print('AC')
else:
  print('WA')
Buggy python submission (verdict: Runtime Error):
sal
n = int(input())
a = list(map(int, input().split()))
print(sum(a)-len(a))


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

ans=0
for i in range(n):
  ans+=a[i]-1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
a,b,k=map(int, input().split())
for i in range(a,b+1):
  if i<=a+k-1 or b-k+1<=i:
    print(i,end=" ")


Fixed submission:
a,b,k=map(int,input().split())
ans=[]
for i in range(a,min(a+k,b+1)):
    ans.append(i)
for j in range(b,max(b-k,a-1),-1):
    if j not in ans:
        ans.append(j)
ans.sort()
for k in range(len(ans)):
  print(ans[k])

Buggy python submission (verdict: Time Limit Exceeded):
a,b,k=map(int, input().split())
for i in range(a,b+1):
  if i<=a+k-1 or b-k+1<=i:
    print(i,end=" ")

Fixed submission:
a,b,k=map(int,input().split())
ans=[]
for i in range(a,min(a+k,b+1)):
    ans.append(i)
for j in range(b,max(b-k,a-1),-1):
    if j not in ans:
        ans.append(j)
ans.sort()
for k in range(len(ans)):
  print(ans[k])

Buggy python submission (verdict: Time Limit Exceeded):
a,b,k=map(int, input().split())
l=[int(i) for i in range(a,b+1)]
l2=(l[:k]+l[-k:])
if 2*k>b-a+1:
  print(" ".join(map(str, l)))
else:
  print(" ".join(map(str, l2)))

Fixed submission:
a,b,k=map(int,input().split())
ans=[]
for i in range(a,min(a+k,b+1)):
    ans.append(i)
for j in range(b,max(b-k,a-1),-1):
    if j not in ans:
        ans.append(j)
ans.sort()
for k in range(len(ans)):
  print(ans[k])

Buggy python submission (verdict: Time Limit Exceeded):
a,b,k=map(int, input().split())
l=[int(i) for i in range(a,b+1)]

l2=set(l[:k]+l[-k:])

print(" ".join(map(str, sorted(l2)) ))

Fixed submission:
a,b,k=map(int,input().split())
ans=[]
for i in range(a,min(a+k,b+1)):
    ans.append(i)
for j in range(b,max(b-k,a-1),-1):
    if j not in ans:
        ans.append(j)
ans.sort()
for k in range(len(ans)):
  print(ans[k])
Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
if abs(a-b)<=d and abs(b-c)<=d:
  if abs(a-c)<=d:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Fixed submission:
a,b,c= map(int,input().split())
if a+b>=c:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
yandy
N = input()
a = list(map(int, input().split()))

a.sort(reverse=True)

Alice = a[0::2]
Bob = a[1::2]

print(sum(Alice) - sum(Bob))


Fixed submission:
n=int(input())
a=list(map(int,input().split()))
a.sort()
a.reverse()
#print(a)
b=[]
c=[]
for i in range(n):
  if i%2==0:
    b.append(a[i])
  else:
    c.append(a[i])
print(sum(b)-sum(c))
Buggy python submission (verdict: Runtime Error):

a=list(map(int,input().split()))
a.sort()
count=a[2]-a[1]
print(count)
if a[0]-count%2==0:
  print((a[2]-(a[0]+count))//2)
else:
  print(2+(a[2]-(a[0]+count))//2)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))

maxans=0
for i in range(n):
  ans=sum(a[0:i+1]+b[i:n])
  maxans=max(ans,maxans)
print(maxans)
Buggy python submission (verdict: Runtime Error):
yandy
H, W = map(int, input().split())
S = [input() for _ in range(H)]

A = [''] * H

di = [(1,0),(-1,0),(0,1),(0,-1),(1,1),(1,-1),(-1,1),(-1,-1)]

for h in range(H):
    for w in range(W):
        if S[h][w] == '#':
            A[h] += '#'
        else:
            c = 0
            for d in di:
                h1 = h + d[0]
                w1 = w + d[1]
                if 0 <= h1 < H and 0 <= w1 < W:
                    if S[h1][w1] == '#':
                        c += 1
            A[h] += str(c)

for i in range(H):
    print(A[i])



Fixed submission:
H, W = map(int, input().split())
S = [input() for _ in range(H)]

A = [''] * H

di = [(1,0),(-1,0),(0,1),(0,-1),(1,1),(1,-1),(-1,1),(-1,-1)]

for h in range(H):
    for w in range(W):
        if S[h][w] == '#':
            A[h] += '#'
        else:
            c = 0
            for d in di:
                h1 = h + d[0]
                w1 = w + d[1]
                if 0 <= h1 < H and 0 <= w1 < W:
                    if S[h1][w1] == '#':
                        c += 1
            A[h] += str(c)

for i in range(H):
    print(A[i])
Buggy python submission (verdict: Runtime Error):
s=input()
for i in range(len(s)):
  print(s[2*i],end="")

Fixed submission:
s=input()
for i in range(0,len(s),2):
  print(s[i],end="")
Buggy python submission (verdict: Runtime Error):
k=set("aqwertyuioplkjhgfdsazxcvbnm")
s=set(input())
ks=list(k-s)
if len(ks)==0:
  print("None")
else:
  ks.sort()
print(ks[0])

Fixed submission:
k=set("aqwertyuioplkjhgfdsazxcvbnm")
s=set(input())
ks=list(k-s)
if len(ks)==0:
  print("None")
else:
  ks.sort()
  print(ks[0])

Buggy python submission (verdict: Runtime Error):
k=set("aqwertyuioplkjhgfdsazxcvbnm")
s=set(input())
ks=list(k-s)
ks.sort()
print(ks[0])

Fixed submission:
k=set("aqwertyuioplkjhgfdsazxcvbnm")
s=set(input())
ks=list(k-s)
if len(ks)==0:
  print("None")
else:
  ks.sort()
  print(ks[0])
Buggy python submission (verdict: Runtime Error):
yandy
N = int(input())
a = [int(input()) for i in range(N)]

num = 0
now = 0
been = set()
been.add(0)

while now != 1:
    now = a[now] - 1
    if now in been:
        num = -1
        break
    else:
        been.add(now)
        num += 1

print(num)


Fixed submission:
n = int(input())
a = [0] + [int(input()) for i in range(n)]
c = a[1]
p = 1
while c > 2:
    d = a[c]
    a[c] = 0
    c = d
    p += 1

if c == 2:
    print(p)
else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int, input().split()))

l=[0]*8

for i in range(n):
  if a[i]<399:
    l[0]="t"
  elif a[i]<799:
    l[1]="t"
  elif a[i]<1199:
    l[2]="t"
  elif a[i]<1599:
    l[3]="t"
  elif a[i]<1999:
    l[4]="t"
  elif a[i]<2399:
    l[5]="t"
  elif a[i]<2799:
    l[6]="t"
  elif a[i]<3199:
    l[7]="t"
  else:
    l[8]+=1
countt=l.count("t")

if countr==0:
  print(countt,countt)
else:
  print(max(0,countt-l[8]),min(countt+1,8))

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

l=[0]*9

for i in range(n):
  if a[i]<400:
    l[0]="t"
  elif a[i]<800:
    l[1]="t"
  elif a[i]<1200:
    l[2]="t"
  elif a[i]<1600:
    l[3]="t"
  elif a[i]<2000:
    l[4]="t"
  elif a[i]<2400:
    l[5]="t"
  elif a[i]<2800:
    l[6]="t"
  elif a[i]<3200:
    l[7]="t"
  else:
    l[8]+=1
countt=l.count("t")

if l[8]==0:
  print(countt,countt)
else:
  print(max(countt,1),countt+l[8])

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int, input().split()))

l=[0]*8

for i in range(n):
  if a[i]<399:
    l[0]="t"
  elif a[i]<799:
    l[1]="t"
  elif a[i]<1199:
    l[2]="t"
  elif a[i]<1599:
    l[3]="t"
  elif a[i]<1999:
    l[4]="t"
  elif a[i]<2399:
    l[5]="t"
  elif a[i]<2799:
    l[6]="t"
  elif a[i]<3199:
    l[7]="t"
  else:
    l[8]+=1
countt=l.count("t")

if countr=0:
  print(countt,countt)
else:
  print(max(0,countt-l[8]),min(countt+1,8))
    

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

l=[0]*9

for i in range(n):
  if a[i]<400:
    l[0]="t"
  elif a[i]<800:
    l[1]="t"
  elif a[i]<1200:
    l[2]="t"
  elif a[i]<1600:
    l[3]="t"
  elif a[i]<2000:
    l[4]="t"
  elif a[i]<2400:
    l[5]="t"
  elif a[i]<2800:
    l[6]="t"
  elif a[i]<3200:
    l[7]="t"
  else:
    l[8]+=1
countt=l.count("t")

if l[8]==0:
  print(countt,countt)
else:
  print(max(countt,1),countt+l[8])
Buggy python submission (verdict: Runtime Error):
全部１０の倍数ならNG
一番小さい10お倍数以外を引く

Fixed submission:
n=int(input())
a = []

for i in range(n):
  a.append(int(input()))
a.sort()
suma=sum(a)
if suma%10!=0:
  print(suma)
  exit()
else:
  for i in range(n):
    suma=suma-a[i]
    if suma%10!=0:
      print(suma)
      exit()
    else:
      suma=suma+a[i]
print(0)
Buggy python submission (verdict: Runtime Error):
yandy
N, M = map(int, input().split())

num = [0] * N

for i in range(M):
    a, b = map(int, input().split())
    num[a-1] += 1
    num[b-1] += 1

for i in num:
    print(i)


Fixed submission:
n,m=map(int,input().split())
l=[0]*n
for i in range(m):
  a,b=map(int,input().split())
  l[a-1]+=1
  l[b-1]+=1
for i in range(n):
  print(l[i])

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
d=dict()
for i in range(b):
  s,l=input().split()
  if s in d.keys():
    d[s]+=1
    if l in d.keys():
      d[l]+=1
    else:
      d[l]=1
  else:
    d[s]=1
    if l in d.keys():
      d[l]+=1
    else:
      d[l]=1
score_sorted = sorted(d.items(), key=lambda x:x[0])

for i in range(a):
  print(score_sorted[i][1])


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


for i in range(len(a)):
  print(a[i]+b[i],end="")

Fixed submission:
a=input()
b=input()

if len(a)==len(b):
  for i in range(len(a)):
    print(a[i]+b[i],end="")
else:
  k=""
  for i in range(len(a)-1):
    k+=a[i]+b[i]
  print(k+a[-1])