Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
S = list(input())
T = list(input())

change = []
flag = 0
get = 0

for i in range(len(S)):
  if S[0] == T[i]:
    get = 1
    for j in range(len(S) - i):
      change.append(T[j+i])
    for k in range(i):
      change.append(T[k])
      
if get == 1:
	for check in range(len(S)):
  		if S[check] != change[check]:
    		flag = 1

if flag == 1:
  print("No")
else:
  print("Yes")

Fixed submission:
Spr = input()
T = list(input())
S = list(Spr)

change = ""
ok = 0

for i in range(len(S)):
  if S[0] == T[i]:
    for j in range(len(S) - i):
      change += T[j+i]
    for k in range(i):
      change += T[k]
    if Spr == change:
      if ok == 0:
      	print("Yes")
      	ok = 1
    change = ""

if i == len(S) - 1 and ok == 0:
  print("No")

Buggy python submission (verdict: Runtime Error):
S = input()
T = list(input())

change = []
flag = 0

for i in range(len(S)):
  if S[0] == T[i]:
    for j in range(len(S) - i):
      change.append(T[j+i])
    for k in range(i):
      change.append(T[k])
      
for check in range(len(S)):
  if S[check] != change[check]:
    flag = 1

if flag == 1:
  print("No")
else:
  print("Yes")

Fixed submission:
Spr = input()
T = list(input())
S = list(Spr)

change = ""
ok = 0

for i in range(len(S)):
  if S[0] == T[i]:
    for j in range(len(S) - i):
      change += T[j+i]
    for k in range(i):
      change += T[k]
    if Spr == change:
      if ok == 0:
      	print("Yes")
      	ok = 1
    change = ""

if i == len(S) - 1 and ok == 0:
  print("No")
Buggy python submission (verdict: Runtime Error):
a,b = (int(i) for i in input().split())

length = b - a
count = length - 1

for j in range(length):
  a -= count
  print(a)
  if a =< 0:
    print(1 - a)
    break
  else:
    count -= 1
    print(count)

Fixed submission:
a,b = (int(i) for i in input().split())

length = b - a
result = 0

for j in range(length):
  result += j
  
print(result + length - b)
Buggy python submission (verdict: Runtime Error):
K = int(input())

result = ""

for i in range(K):
  if i == K - 1:
    result += K
  else:
    result += K
    
print(K)
print(result)


Fixed submission:
K = int(input())

N = 50

ans = [i for i in range(N)]
x,y = divmod(K,N)

ans = list(map(lambda a:a+x,ans))

for i in range(y):
    ans[i] += N + 1
    ans = list(map(lambda a:a-1,ans))

print(N)
print(*ans)
Buggy python submission (verdict: Runtime Error):
# -*- coding:utf-8 -*-
import sys
N = int(input())
lis = []
for i in range(N):
    s_raw = input().split()
    s = [int(j) for j in s_raw]
    lis.append(s)

def travel(t, x, y, count):
    if t > lis[N-1][0]:
        print("Yes")
        sys.exit()
    if t == lis[count][0]:
        if x == lis[count][1] and y == lis[count][2]:
            count += 1
        else:
            return
    travel(t+1, x+1, y, count)
    travel(t+1, x-1, y, count)
    travel(t+1, x, y+1, count)
    travel(t+1, x, y-1, count)

travel(0, 0, 0, 0)
print("No")


Fixed submission:
# -*- coding:utf-8 -*-
N = int(input())

for i in range(N):
    t, x, y = map(int, input().split())
    if (x+y) > t or (x+y+t) % 2 == 1:
        print("No")
        exit()
print("Yes")

Buggy python submission (verdict: Runtime Error):
# -*- coding:utf-8 -*-
import sys
N = int(input())
lis = []
for i in range(N):
    s_raw = input().split()
    s = [int(j) for j in s_raw]
    lis.append(s)

def travel(t, x, y, count):
    if t > lis[N-1][0]:
        print("YES")
        sys.exit()
    if t == lis[count][0]:
        if x == lis[count][1] and y == lis[count][2]:
            count += 1
        else:
            return
    travel(t+1, x+1, y, count)
    travel(t+1, x-1, y, count)
    travel(t+1, x, y+1, count)
    travel(t+1, x, y-1, count)

travel(0, 0, 0, 0)
print("NO")


Fixed submission:
# -*- coding:utf-8 -*-
N = int(input())

for i in range(N):
    t, x, y = map(int, input().split())
    if (x+y) > t or (x+y+t) % 2 == 1:
        print("No")
        exit()
print("Yes")
Buggy python submission (verdict: Runtime Error):
# -*- coding:utf-8 -*-

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

count = 0

for i in range((Y//10000)+1):
    for j in range((Y//5000)+1):
        k = (Y -i*10000 + j*5000) // 1000
        if i + j + k == N:
            print("{0} {1} {2}".format(i, j, k))
            exit()

print("-1 -1 -1")


Fixed submission:
# -*- coding:utf-8 -*-
N, Y = map(int, input().split())
flag = False

def isValid(l, m, n):
    sum = l*10000 + m*5000 + n*1000
    if sum == Y:
        return True
    return False

for i in reversed(range(N+1)):
    for j in range(N+1):
        if i + j > N:
            break
        else:
            if isValid(i, j, N-i-j):
                flag = True
                print("{0} {1} {2}".format(i, j, N-i-j))
                break
        if flag:
            break
    if flag:
        break

if not flag:
    print("-1 -1 -1")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
As = list(map(int, input().split()))


for skip_num in range(N):
    sum = 0
    pos = 0
    for i in range(N):
        if i == skip_num:
            continue
        sum += abs(pos - As[i])
        pos = As[i]
    sum += abs(pos)
    print(sum)


Fixed submission:
N = int(input())
As = [0]
As.extend(map(int, input().split()))
As.append(0)

sum = 0
pos = 0
for i in range(1, N + 2):
    sum += abs(pos - As[i])
    pos = As[i]

for i in range(1, N + 1):
    skip_pos = As[i]
    pre_pos = As[i - 1]
    post_pos = As[i + 1]

    if (pre_pos - skip_pos) * (post_pos - skip_pos) <= 0:
        print(sum)
    else:
        print(sum - abs(pre_pos - skip_pos) - abs(post_pos - skip_pos) + abs(pre_pos - post_pos))
Buggy python submission (verdict: Runtime Error):
H, W = map(int, input().split())
table = []
table.append(list("_" * (W + 2)))
for _ in range(H):
    table.append(list("_" + input() + "_"))
table.append(list("_" * (W + 2)))

for h in range(1, H + 1):
    for w in range(1, W + 1):
        if table[h][w] == "#":
            continue
        count = 0
        for _h in [-1, 0, +1]:
            for _w in [-1, 0, +1]:
                print(h + _h, w + _w)
                if table[h + _h][w + _w] == "#":
                    count += 1
        table[h][w] = str(count)

for h in range(1, H + 1):
    print("".join(table[h]).replace("_", ""))


Fixed submission:
a, b, c = input().split(" ")

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

Buggy python submission (verdict: Runtime Error):
H, W = map(int, input().split())
table = []
table.append(list("_" * (W + 2)))
for _ in range(H):
    table.append(list("_" + input() + "_"))
table.append(list("_" * (W + 2)))

for h in range(1, H + 1):
    for w in range(1, W + 1):
        if table[h][w] == "#":
            continue
        count = 0
        print(h, w, "---------")
        for _h in [-1, 0, +1]:
            for _w in [-1, 0, +1]:
                print(h + _h, w + _w)
                if table[h + _h][w + _w] == "#":
                    count += 1
        table[h][w] = str(count)

for h in range(1, H + 1):
    print("".join(table[h]).replace("_", ""))


Fixed submission:
a, b, c = input().split(" ")

if a == b:
    print(c)
elif a == c:
    print(b)
else:
    print(a)
Buggy python submission (verdict: Runtime Error):
n=input()
s=input()
t=s.count('R')
if 2*t>n:
    print('Yes')
else:
    print('No')

Fixed submission:
n=int(input())
s=input()
t=s.count('R')
if 2*t>n:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
%%time
n,q=map(int,input().split())
c=input()
s=[input().split() for _ in [0]*q]
def judge(x,opt):
    for y in s:
        if y[0]==c[x]:
            if y[1]=='L':
                x-=1
            else:
                x+=1
            if not opt:
                if x>=n:
                    return False
                elif x<0:
                    return True
            else:
                if x<0:
                    return False
                elif x>=n:
                    return True
    return False
def bisect(l,r,opt):
    print(l,r)
    center=(r+l)//2
    if judge(center,opt):
        if r-l<=1:
            if not opt:
                return l+1
            else:
                return  n-l
        if not opt:
            return bisect(center+1,r,opt)
        else:
            return bisect(l,center,opt)
    else:
        if r-l<=1:
            if not opt:
                return l
            else:
                return n-r
        if not opt:
            return bisect(l,center,opt)
        else:
            return bisect(center+1,r,opt)
def func():
    l=bisect(0,n,0)
    r=bisect(0,n,1)
    print(n-l-r)
func()

Fixed submission:
n,q=map(int,input().split())
c=input()
s=[input().split() for _ in [0]*q]
def judge(x,opt):
    for y in s:
        if y[0]==c[x]:
            if y[1]=='L':
                x-=1
            else:
                x+=1
            if not opt:
                if x>=n:
                    return False
                elif x<0:
                    return True
            else:
                if x<0:
                    return False
                elif x>=n:
                    return True
    return False
def bisect(l,r,opt):
    center=(r+l)//2
    if judge(center,opt):
        if r-l<=1:
            if not opt:
                return l+1
            else:
                return  n-l
        if not opt:
            return bisect(center+1,r,opt)
        else:
            return bisect(l,center,opt)
    else:
        if r-l<=1:
            if not opt:
                return l
            else:
                return n-r
        if not opt:
            return bisect(l,center,opt)
        else:
            return bisect(center+1,r,opt)
def func():
    l=bisect(0,n,0)
    r=bisect(0,n,1)
    print(n-l-r)
func()
Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(100005)
_=int(input())
s=input()
mod=7+10**9
def dp(t,l):
    if len(t)==1:
        if t[0] in l:
            return 1
        else:
            return 2
    if t[0] in l:
        return dp(t[1:],l)%mod
    else:
        g=l+[t[0]]
        ans=dp(t[1:],g)+dp(t[1:],l)
        ans%=mod
        return ans

print(dp(s,[])-1)

Fixed submission:
_=input()
s=input()
mod=7+10**9
ans=1
for i in range(26):
    ans*=1+s.count(chr(ord('a') + i))
    ans%=mod
print(ans-1)

Buggy python submission (verdict: Runtime Error):
_=input()
s=input().rstrip()
mod=7+10**9
def dp(t,l):
    if len(t)==1:
        if t[0] in l:
            return 1
        else:
            return 2
    elif t[0] in l:
        return dp(t[1:],l)%mod
    else:
        g=l+[t[0]]
        ans=dp(t[1:],g)+dp(t[1:],l)
        ans%=mod
        return ans
print(dp(s,[])-1)

Fixed submission:
_=input()
s=input()
mod=7+10**9
ans=1
for i in range(26):
    ans*=1+s.count(chr(ord('a') + i))
    ans%=mod
print(ans-1)

Buggy python submission (verdict: Runtime Error):
_=int(input())
s=input()
mod=7+10**9
def dp(t,l):
    if len(t)==1:
        if t[0] in l:
            return 1
        else:
            return 2
    elif t[0] in l:
        return dp(t[1:],l)%mod
    else:
        g=l+[t[0]]
        ans=dp(t[1:],g)+dp(t[1:],l)
        ans%=mod
        return ans
print(dp(s,[])-1)

Fixed submission:
_=input()
s=input()
mod=7+10**9
ans=1
for i in range(26):
    ans*=1+s.count(chr(ord('a') + i))
    ans%=mod
print(ans-1)

Buggy python submission (verdict: Runtime Error):
_=int(input())
s=input()
mod=7+10**9
def dp(t,l):
    if len(t)==1:
        if t[0] in l:
            return 1
        else:
            return 2
    if t[0] in l:
        return dp(t[1:],l)%mod
    else:
        ans=dp(t[1:],l+[t[0]])+dp(t[1:],l)
        ans%=mod
        return ans
print(dp(s,[])-1)

Fixed submission:
_=input()
s=input()
mod=7+10**9
ans=1
for i in range(26):
    ans*=1+s.count(chr(ord('a') + i))
    ans%=mod
print(ans-1)

Buggy python submission (verdict: Runtime Error):
_=int(input())
s=input()
mod=7+10**9
def dp(t,l):
    if len(t)==1:
        if t[0] in l:
            return 1
        else:
            return 2
    if t[0] in l:
        return dp(t[1:],l)
    else:
        return (dp(t[1:],l+[t[0]])+dp(t[1:],l))%mod
print(dp(s,[])-1)

Fixed submission:
_=input()
s=input()
mod=7+10**9
ans=1
for i in range(26):
    ans*=1+s.count(chr(ord('a') + i))
    ans%=mod
print(ans-1)
Buggy python submission (verdict: Runtime Error):
mod=7+10**9
n=int(input())
c=[int(input()) for _ in [0]*n]
data=[0]*n+[1]
def dp(k,l):
    if data[k]>0:
        return data[k]
    if k>=n-1:
        return 1
    ans=0
    i=0
    while i<len(l):
        if l[i]==l[0]:
            j=i
            while j<len(l) and l[j]==l[0]:
                j+=1
            ans+=dp(j,l[j:])
            ans%=mod
            i=j
        i+=1
    data[k]=ans%mod
    return data[k]
print(dp(c))

Fixed submission:
mod=7+10**9
n=int(input())
c=['$']+[int(input()) for _ in [0]*n]
data=[1]+[0]*n
s={}

for i in range(1,n+1):
  if c[i] in s.keys():
    if c[i]!=c[i-1]:
      s[c[i]]+=data[i-1]
      s[c[i]]%=mod
  else:
    s[c[i]]=data[i-1]
  data[i]=s[c[i]]%mod
        
print(data[n])

Buggy python submission (verdict: Runtime Error):
mod=7+10**9
n=int(input())
c=[int(input()) for _ in [0]*n]
data=[0]*n
def dp(k,l):
    if data[k]>0:
        return data[k]
    if len(l)<=1:
        return 1
    ans=0
    i=0
    while i<len(l):
        if l[i]==l[0]:
            j=i
            while j<len(l) and l[j]==l[0]:
                j+=1
            ans+=dp(j,l[j:])
            ans%=mod
            i=j
        i+=1
    data[k]=ans%mod
    return data[k]
print(dp(c))

Fixed submission:
mod=7+10**9
n=int(input())
c=['$']+[int(input()) for _ in [0]*n]
data=[1]+[0]*n
s={}

for i in range(1,n+1):
  if c[i] in s.keys():
    if c[i]!=c[i-1]:
      s[c[i]]+=data[i-1]
      s[c[i]]%=mod
  else:
    s[c[i]]=data[i-1]
  data[i]=s[c[i]]%mod
        
print(data[n])

Buggy python submission (verdict: Time Limit Exceeded):
mod=7+10**9
n=int(input())
c=[int(input()) for _ in [0]*n]
def dp(l):
    if not l:
        return 1
    if len(l)==1:
        return 1
    ans=0
    i=0
    while i<len(l):
        if l[i]==l[0]:
            j=i
            while j<len(l) and l[j]==l[0]:
                j+=1
            ans+=dp(l[j:])
            ans%=mod
            i=j
        i+=1
    return ans%mod
print(dp(c))

Fixed submission:
mod=7+10**9
n=int(input())
c=['$']+[int(input()) for _ in [0]*n]
data=[1]+[0]*n
s={}

for i in range(1,n+1):
  if c[i] in s.keys():
    if c[i]!=c[i-1]:
      s[c[i]]+=data[i-1]
      s[c[i]]%=mod
  else:
    s[c[i]]=data[i-1]
  data[i]=s[c[i]]%mod
        
print(data[n])
Buggy python submission (verdict: Runtime Error):
a = input().split('/')
a = list(map(int, a))
if a[0] < 2019:
  print('Heisei')
elif a[1] < 5:
  print('Heisei')
else:
  print('TBD')
a = input().split('/')
if a[0] < 2019:
  print('Heisei')
elif a[1] < 5:
  print('Heisei')
else:
  print('TBD')

Fixed submission:
a = input().rstrip().split('/')
a = list(map(int, a))
if a[0] < 2019:
  print('Heisei')
elif a[1] < 5:
  print('Heisei')
else:
  print('TBD')

Buggy python submission (verdict: Runtime Error):
a = input().split('/')
if a[0] < 2019:
  print('Heisei')
elif a[1] < 5:
  print('Heisei')
else:
  print('TBD')

Fixed submission:
a = input().rstrip().split('/')
a = list(map(int, a))
if a[0] < 2019:
  print('Heisei')
elif a[1] < 5:
  print('Heisei')
else:
  print('TBD')
Buggy python submission (verdict: Runtime Error):
n = int(input().rstrip())
m = 0
for i in range(n):
  a, b = input().rstrip().split(' ')
  a = int(a)
  if b == 'BTC':
    a = 380000*a
  m += a
print(m)

Fixed submission:
n = int(input().rstrip())
m = 0
for i in range(n):
  a, b = input().rstrip().split(' ')
  a = float(a)
  if b == 'BTC':
    a = 380000*a
  m += a
print(m)

Buggy python submission (verdict: Runtime Error):
n = int(input())
m = 0
for i in range(n):
  a, b = input().split(' ')
  a = int(a)
  if b == 'BTC':
    a = 380000*a
    m = m + a
  else:
    m = m + a
print(m)

Fixed submission:
n = int(input().rstrip())
m = 0
for i in range(n):
  a, b = input().rstrip().split(' ')
  a = float(a)
  if b == 'BTC':
    a = 380000*a
  m += a
print(m)

Buggy python submission (verdict: Runtime Error):
n = int(input())
m = 0
for i in range(n):
  a, b = input().split(' ')
  a = int(a)
  if b == 'BTC':
    a = 380000.0*a
  m += a
print(m)

Fixed submission:
n = int(input().rstrip())
m = 0
for i in range(n):
  a, b = input().rstrip().split(' ')
  a = float(a)
  if b == 'BTC':
    a = 380000*a
  m += a
print(m)

Buggy python submission (verdict: Runtime Error):
n = int(input())
m = 0
for i in range(n):
  a, b = input().split(' ')
  a = int(a)
  if b == 'BTC':
    a = 380000*a
  m += a
print(m)

Fixed submission:
n = int(input().rstrip())
m = 0
for i in range(n):
  a, b = input().rstrip().split(' ')
  a = float(a)
  if b == 'BTC':
    a = 380000*a
  m += a
print(m)
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = map(int, input().split())
s = 0
t = 0
for x in l:
  s += x
  t = max(x, t)
if s>t:
  print(Yes)
else:
  print(No)

Fixed submission:
n = int(input())
l = map(int, input().split())
s = 0
t = 0
for x in l:
  s += x
  t = max(x, t)
if s>2*t:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
x = list(set(map(int, input().split())))
l = [x[i+1]-x[i] for i in range(n-1)]
l.sort(reverse=True)
print(sum(l[n-1:]))

Fixed submission:
n, m = map(int, input().split())
x = list(map(int, input().split()))
x.sort()
l = [x[i+1]-x[i] for i in range(m-1)]
l.sort(reverse=True)
print(sum(l[n-1:]))
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
_sum = list(map(int, input().split()))
m, f = 0, 0
for i in range(40, -1, -1):
  _sum = sum(map(lambda x: (x >> i) & 1, _sum))
  _min = min(_sum, n-_sum) << i
  _max = max(_sum, n-_sum) << i
  s = 0 if _sum > n//2 else 1 << i
  if s > max(k - m, 0):
    f += _min
  elif s > 0:
    m += s
    f += _max
  else:
    f += _max
print(f)

Fixed submission:
n, k = map(int, input().split())
a = list(map(int, input().split()))
_sum = [0]*41
ans = 0
f = 0
 
for x in a:
  for i in range(41):
    _sum[i] += (x >> i) & 1
for i in range(41):
  if _sum[i] <= n//2:
    _sum[i] = 1
  else:
    _sum[i] = 0
for i in range(40, -1, -1):
  s = _sum[i] << i
  ans += s
  if ans > k:
    ans -= s
for x in a:
  f += x ^ ans
print(f)
Buggy python submission (verdict: Runtime Error):
N, Y=map(int,input().split())
flag=False

for i in range(0,N+1):
    for j in range(0, N+1):
        if Y==10000*(N-i-j)+5000*i+1000*j and i+j=<N:
            flag=True
            print(N-i-j, i, j)
            break
    if flag:
        break
else:
    print('-1 -1 -1')

Fixed submission:
N, Y=map(int,input().split())
flag=False

for i in range(0,N+1):
    for j in range(0, N+1):
        if Y==10000*(N-i-j)+5000*i+1000*j and i+j<=N:
            flag=True
            print(N-i-j, i, j)
            break
    if flag:
        break
else:
    print('-1 -1 -1')
Buggy python submission (verdict: Runtime Error):
from collections import Counter
from pandas import Series, DataFrame
 
N,K=map(int,input().split())
A=list(map(int,input().split()))
count=0
S=set(A)
c=Counter(A)
L=c.most_common(len(S))
 
x=len(S)-1
for _ in range(len(S)-K):
    count=count+int(L[x][1])
    x=x-1
 
print(count)

Fixed submission:
from collections import Counter


N,K=map(int,input().split())
A=list(map(int,input().split()))
count=0
S=set(A)
c=Counter(A)
L=c.most_common(len(S))

x=len(S)-1
for _ in range(len(S)-K):
    count=count+int(L[x][1])
    x=x-1

print(count)

Buggy python submission (verdict: Runtime Error):
from collections import Counter
from pandas import Series
 
N,K=map(int,input().split())
A=list(map(int,input().split()))
count=0
S=set(A)
c=Counter(A)
L=c.most_common(len(S))
 
x=len(S)-1
for _ in range(len(S)-K):
    count=count+int(L[x][1])
    x=x-1
 
print(count)

Fixed submission:
from collections import Counter


N,K=map(int,input().split())
A=list(map(int,input().split()))
count=0
S=set(A)
c=Counter(A)
L=c.most_common(len(S))

x=len(S)-1
for _ in range(len(S)-K):
    count=count+int(L[x][1])
    x=x-1

print(count)

Buggy python submission (verdict: Runtime Error):
from collections import Counter
from pandas import Series

N,K=map(int,input().split())
A=list(map(int,input().split()))
count=0
S=set(A)
c=Counter(A)
L=c.most_common(len(S))

x=len(S)-1
for _ in range(len(S)-K):
    count=count+int(L[x][1])
    x=x-1

print(count)

Fixed submission:
from collections import Counter


N,K=map(int,input().split())
A=list(map(int,input().split()))
count=0
S=set(A)
c=Counter(A)
L=c.most_common(len(S))

x=len(S)-1
for _ in range(len(S)-K):
    count=count+int(L[x][1])
    x=x-1

print(count)
Buggy python submission (verdict: Runtime Error):
# coding :utf-8
N=int(input())

F=[]
P=[]

table = [2**i for i in range(10)]
#print(table)

for i in range(N):
    lis = list(map(int, input().split()))
    F.append(lis)
#print(F)
for i in range(N):
    lis = list(map(int, input().split()))
    P.append(lis)
#print(P)

max=-1000000000001

for i in range(1,1024):
    total=0
    for j in range(N):
        n=0
        for k in range(10):
            n +=(1 if i&table[k] !=0 else 0)*F[j][t]
        total += P[j][n]
    if total >maxx:
        maxx= total
print(maxx)

Fixed submission:
# coding :utf-8
N=int(input())

F=[]
P=[]

table = [2**i for i in range(10)]
#print(table)

for i in range(N):
    lis = list(map(int, input().split()))
    F.append(lis)
#print(F)
for i in range(N):
    lis = list(map(int, input().split()))
    P.append(lis)
#print(P)

maxx=-1000000000001

for i in range(1,1024):
    total=0
    for j in range(N):
        n=0
        for k in range(10):
            n +=(1 if i&table[k] !=0 else 0)*F[j][k]
        total += P[j][n]
    if total >maxx:
        maxx= total
print(maxx)
Buggy python submission (verdict: Runtime Error):
H, W=map(int,input().split(' '))
c=[list(map(int,input().split(' '))) for i in range(10)]
a=[list(map(int,input().split(' '))) for i in range(H)]
ans=0

for i in range(10):
    for j in range(10):
        for k in range(10):
            c[i][j]=min(c[i][j],c[i][k]+c[k][j])

for i in range(H):
    for j in range(W):
        if a[i][j]>=0:
            ans += c[a[i][j]][1]

print(ans)


Fixed submission:
# coding: utf-8
# 整数の入力
a, b, c, d = [int(i) for i in input()]
# 計算
if a+b+c+d == 7:
    s = "{}+{}+{}+{}=7"
elif a+b+c-d == 7:
    s = "{}+{}+{}-{}=7"
elif a+b-c+d == 7:
    s = "{}+{}-{}+{}=7"
elif a+b-c-d == 7:
    s = "{}+{}-{}-{}=7"
elif a-b+c+d == 7:
    s = "{}-{}+{}+{}=7"
elif a-b+c-d == 7:
    s = "{}-{}+{}-{}=7"
elif a-b-c+d == 7:
    s = "{}-{}-{}+{}=7"
elif a-b-c-d == 7:
    s = "{}-{}-{}-{}=7"
# 出力
print(s.format(a, b, c, d))
Buggy python submission (verdict: Runtime Error):
from collections import Counter
 
N = int(input())
A = list(map(int, input().split()))
 
C = Counter(A)
 
ans = 0
for i in range(max(A)+1):
    ans = max(C[i] + C[i-1] + C[i+1], ans)
 
print(ans)
from collections import Counter

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

C = Counter(A)

ans = 0
for i in range(max(A)+1):
    ans = max(C[i] + C[i-1] + C[i+1], ans)

print(ans)


Fixed submission:
from collections import Counter
 
N = int(input())
A = list(map(int, input().split()))
 
C = Counter(A)
 
ans = 0
for i in range(max(A)+1):
    ans = max(C[i] + C[i-1] + C[i+1], ans)
 
print(ans)