Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
h, w = input().split()
h = int(h)
w = int(w)
field = []
for _ in range(h):
    field.append(input())
    
ans = True
for i in range(h):
    for j in range(w):
        if field[i][j] == '#':
            temp = 1
            dd = [(1, 0), (-1, 0), (0, 1), (0, -1)]
            for ddd in dd:
                dx, dy = ddd
                nx, ny = x + dx, y + dy
                if nx >= 0 and nx < h and ny >= 0 and ny < w and field[nx][ny] == '#':
                    temp += 1
            if temp == 1:
                ans = False
                break

if ans:
    print("Yes")
else:
    print("No")

Fixed submission:
h, w = input().split()
h = int(h)
w = int(w)
field = []
for _ in range(h):
    field.append(input())
    
ans = True
for i in range(h):
    for j in range(w):
        if field[i][j] == '#':
            temp = 1
            dd = [(1, 0), (-1, 0), (0, 1), (0, -1)]
            for ddd in dd:
                dx, dy = ddd
                nx, ny = i + dx, j + dy
                if nx >= 0 and nx < h and ny >= 0 and ny < w and field[nx][ny] == '#':
                    temp += 1
            if temp == 1:
                ans = False
                break

if ans:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Time Limit Exceeded):
h, w = input().split()
h = int(h)
w = int(w)
field = []
for _ in range(h):
    field.append(input())

ans = True
for i in range(h):
    for j in range(w):
        if field[i][j] == '#':
            temp = 0
            que = list()
            que.append((i, j))
            while que:
                x, y = que.pop(0)
                temp += 1
                string = list(field[x])
                string[y] = '.'
                field[x] = ''.join(string)
                dd = [(1, 0), (-1, 0), (0, 1), (0, -1)]
                for ddd in dd:
                    dx, dy = ddd
                    nx, ny = x + dx, y + dy
                    if nx >= 0 and nx < h and ny >= 0 and ny < w and field[nx][ny] == '#':
                        que.append((nx, ny))
            if temp == 1:
                ans = False
                break

if ans:
    print("Yes")
else:
    print("No")

Fixed submission:
h, w = input().split()
h = int(h)
w = int(w)
field = []
for _ in range(h):
    field.append(input())
    
ans = True
for i in range(h):
    for j in range(w):
        if field[i][j] == '#':
            temp = 1
            dd = [(1, 0), (-1, 0), (0, 1), (0, -1)]
            for ddd in dd:
                dx, dy = ddd
                nx, ny = i + dx, j + dy
                if nx >= 0 and nx < h and ny >= 0 and ny < w and field[nx][ny] == '#':
                    temp += 1
            if temp == 1:
                ans = False
                break

if ans:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
As = input().split()
As = [int(A) for A in As]
ss = [0]
sss = 0
for i in range(n):
        sss += As[i]
        ss.append(sss)
ans = 0
for i in range(0, n):
    for j in range(i + 1, n + 1):
        if ss[j] - ss[i] == 0:
            ans += 1
print(ans)

Fixed submission:
n = int(input())
As = input().split()
As = [int(A) for A in As]
ss = [0]
sss = 0
nd = {0: 1}
for i in range(n):
        sss += As[i]
        ss.append(sss)
        if sss in nd:
            nd[sss] += 1
        else:
            nd[sss] = 1
ans = 0
for k in nd:
    if nd[k] > 0:
        ans += (nd[k] * (nd[k] - 1) // 2)
#for i in range(0, n):
#    for j in range(i + 1, n + 1):
#        if ss[j] - ss[i] == 0:
#            ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
a, b, x = input().split()
a = int(a)
b = int(b)
c = int(c)
if a <= x and a + b >= x:
    print("YES")
else:
    print("NO")

Fixed submission:
a, b, c = input().split()
a = int(a)
b = int(b)
c = int(c)
if a <= c and a + b >= c:
    print("YES")
else:
    print("NO")

Buggy python submission (verdict: Runtime Error):
function main()
    a, b, x = split(readline())
    a = parse(Int, a)
    b = parse(Int, b)
    x = parse(Int, x)    
    if a <= x && a + b >= x
        println("YES")
    else
        println("NO")
    end
end
main()

Fixed submission:
a, b, c = input().split()
a = int(a)
b = int(b)
c = int(c)
if a <= c and a + b >= c:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
N = input()
n=1
p=-1
for i in range(4):
    t= N % 10
    if p == t:
        n = n + 1
    p=t
    N = int(N / 10)
ans = "YES" if n >= 3 else "NO"
print(ans)

Fixed submission:
N = int(input())
n=1
p=-1
for i in range(4):
    t= N % 10
    if p == t:
        n = n + 1
        if n == 3: break
    else:
        n = 1
    p=t
    N = int(N / 10)
ans = "Yes" if n == 3 else "No"
print(ans)
Buggy python submission (verdict: Runtime Error):
a = int(input())
if i%2 == 0:
  print(1/2)
else:
  print((a/2+1)/a)

Fixed submission:
a = int(input())
if a%2 == 0:
  print(1/2)
else:
  print((a//2+1)/a)

Buggy python submission (verdict: Runtime Error):
a = int(input('<< '))
k=0
for i in range(1,a):
  if i%2 == 1:
    k += 1
  v = k/a
print(v)

Fixed submission:
a = int(input())
if a%2 == 0:
  print(1/2)
else:
  print((a//2+1)/a)

Buggy python submission (verdict: Runtime Error):
a = int(input('<< '))
k=0
for i in range(1,a):
  if i%2 == 1:
    k += 1
  v = k/a

print v
   
    


Fixed submission:
a = int(input())
if a%2 == 0:
  print(1/2)
else:
  print((a//2+1)/a)

Buggy python submission (verdict: Runtime Error):
import random
a = int(input('<< '))
k=0
for i in range(1,a):
  if i%2 == 1:
    k += 1
  v = k/a

print v
   
    


Fixed submission:
a = int(input())
if a%2 == 0:
  print(1/2)
else:
  print((a//2+1)/a)

Buggy python submission (verdict: Runtime Error):
import random
a = int(input('<< '))
k=0
g=0
for i in range(1,a):
  if i%2 == 1:
    k += 1
  v = k/a

print(v)

Fixed submission:
a = int(input())
if a%2 == 0:
  print(1/2)
else:
  print((a//2+1)/a)

Buggy python submission (verdict: Runtime Error):
import random
a = int(input('<< '))
k=0
g=0
for i in range(1,a):
  if i%2 == 1:
    k += 1
  v = k/a

print v
   
    

Fixed submission:
a = int(input())
if a%2 == 0:
  print(1/2)
else:
  print((a//2+1)/a)
Buggy python submission (verdict: Runtime Error):
S==input()
if S=='Sunny':
  print("Cloudy")
elif S=='Cloudy':
  print("Rainy")
elif S=='Rainy':
  print("Sunny")

Fixed submission:
S=input()
if S=='Sunny':
  print('Cloudy')
elif S=='Cloudy':
  print('Rainy')
elif S=='Rainy':
  print('Sunny')

Buggy python submission (verdict: Runtime Error):
S==input()
if S=='Sunny':
  print('Cloudy')
elif S=='Cloudy':
  print('Rainy')
elif S=='Rainy':
  print('Sunny')

Fixed submission:
S=input()
if S=='Sunny':
  print('Cloudy')
elif S=='Cloudy':
  print('Rainy')
elif S=='Rainy':
  print('Sunny')

Buggy python submission (verdict: Runtime Error):
S==input()
if S=='Sunny':
  print'Cloudy'
elif S=='Cloudy':
  print'Rainy'
elif S=='Rainy':
  print'Sunny'

Fixed submission:
S=input()
if S=='Sunny':
  print('Cloudy')
elif S=='Cloudy':
  print('Rainy')
elif S=='Rainy':
  print('Sunny')
Buggy python submission (verdict: Runtime Error):
p = int(input())
q = int(input())
r = int(input())
a = p + q
b = q + r
c = p + r
print(min(a,b,c))

Fixed submission:
p,q,r = list(map(int,input().split()))
a = p + q
b = q + r
c = p + r
print(min(a,b,c))

Buggy python submission (verdict: Runtime Error):
p = int(input())
q = int(input())
r = int(input())
a = p + q
b = q + r
c = p + r
print(max(a,b,c))

Fixed submission:
p,q,r = list(map(int,input().split()))
a = p + q
b = q + r
c = p + r
print(min(a,b,c))
Buggy python submission (verdict: Runtime Error):
def solve():
  weather_dictionary = {
    'Sunny': 'Cloudy',
    'Coludy': 'Rainy',
    'Rainy': 'Sunny'
  }

  print(weather_dictionary[input()])
  

if __name__ == '__main__':
  solve()


Fixed submission:
weather_forecast = {
	'Sunny': 'Cloudy',
	'Cloudy': 'Rainy',
	'Rainy': 'Sunny'
}
 
print(weather_forecast[input()])

Buggy python submission (verdict: Runtime Error):
# 一日ごとに晴れ(Sunny)、くもり(Cloudy)、雨(Rainy)

weather_forecast {
	'Sunny': 'Cloudy',
	'Cloudy': 'Rainy',
	'Rainy': 'Sunny'
}

print(weather_forecast[intput()])



Fixed submission:
weather_forecast = {
	'Sunny': 'Cloudy',
	'Cloudy': 'Rainy',
	'Rainy': 'Sunny'
}
 
print(weather_forecast[input()])
Buggy python submission (verdict: Runtime Error):
a, b = [int(i) for i in input().split(' ')]
result = [a+b, a-b, a*b]
print(result.max())

Fixed submission:
a, b = [int(i) for i in input().split(' ')]
result = [a+b, a-b, a*b]
print(max(result))

Buggy python submission (verdict: Runtime Error):
a, b = [int(i) for i in input().split(' ')]
result = []
result.append(a + b)
result.append(a - b)
result.append(a * b)

print(result.max())


Fixed submission:
a, b = [int(i) for i in input().split(' ')]
result = [a+b, a-b, a*b]
print(max(result))
Buggy python submission (verdict: Runtime Error):
n = int(raw_input())
if n ==1:
	print 1
else:
	if not n%2:
	  print(0.500000000)
	else:
	  print((int(n/2)+1)/float(n))

Fixed submission:
n = int(raw_input())
if n ==1:
	print 1
else:
	if not n%2:
	  print(0.500000000)
	else:
	  print((int(n/2)+1)/float(n))

Buggy python submission (verdict: Runtime Error):
n = int(raw_input())
n = n +0.000000
if not n%2:
  print 0.500000000
else:
  print((n/2)/n)

Fixed submission:
n = int(raw_input())
if n ==1:
	print 1
else:
	if not n%2:
	  print(0.500000000)
	else:
	  print((int(n/2)+1)/float(n))

Buggy python submission (verdict: Runtime Error):
n = int(raw_input())
if not n%2:
  print 0.500000000
else:
  print((n/2)/n)

Fixed submission:
n = int(raw_input())
if n ==1:
	print 1
else:
	if not n%2:
	  print(0.500000000)
	else:
	  print((int(n/2)+1)/float(n))

Buggy python submission (verdict: Runtime Error):
if N%2:
  return 0.6
else:
  return 0.5

Fixed submission:
n = int(raw_input())
if n ==1:
	print 1
else:
	if not n%2:
	  print(0.500000000)
	else:
	  print((int(n/2)+1)/float(n))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = map(int,input().split())
f = {}
count = 0
for i in a:
  count=+1
  f[count] = i
inv_map = {v: k for k, v in f.items()}
print inv_map[i] for i in range(n)
  

Fixed submission:
n = int(input())
a = map(int,input().split())
f = {}
count = 1
for i in a:
  f[count] = i
  count+=1
inv_map = {v: k for k, v in f.items()}
[print(inv_map[i],end=' ') for i in range(1,n+1)]
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
if N !=1:
    result = sum(range(1,N))
else:
    result = 0
print(result)

Fixed submission:
N = int(input())
result = N * (N-1)//2
print(result)
Buggy python submission (verdict: Time Limit Exceeded):
#C
N = int(input())
pair = [1]
s = ''.join(sorted(input()))
s_set = {s}
s_list = [s]
for i in range(1, N):
    s = ''.join(sorted(input()))
    if s in s_set:
        pair[s_list.index(s)] += 1        
    else:
        s_list.append(s)
        s_set.add(s)
        pair.append(1)
result = 0
for i in pair:
    result += (i * (i-1))//2
print(result)

Fixed submission:
#C
N = int(input())
pairdic = {}
s = ''.join(sorted(input()))
pairdic[s] = 1
for i in range(1, N):
    s = ''.join(sorted(input()))
    if s in pairdic:
        pairdic[s] += 1        
    else:
        pairdic[s] = 1
result = 0
for i in pairdic:
    result += (pairdic[i] * (pairdic[i]-1))//2
print(result)
Buggy python submission (verdict: Runtime Error):
N = int(input())
nm = N//10
sum = 0
for i range(nm):
    if N%2 ==0:
        sum += (10**i-1)
if nm%2 != 0:
    sum += N-(10**nm)+1

Fixed submission:
N = int(input())
nm = len(str(N))-1
summ = 0
for i in range(nm):
    if i ==0:
      summ += 9
    elif i%2 ==0:
      summ += (10**(i+1)-10**(i))
if nm%2 == 0:
    summ += N-(10**nm)+1
print(summ)
Buggy python submission (verdict: Runtime Error):
A, B = input().strip()
K = (A+B)//2
if (A+B)%2 == 0:
    print (K)
else:
    print('IMPOSSIBLE')

Fixed submission:
A, B = map(int,input().split())
K = (A+B)//2
if (A+B) % 2 == 0:
    print(K)
else:
    print('IMPOSSIBLE')
Buggy python submission (verdict: Runtime Error):
N = int(input())
As = []
for i in range(N):
    As.append(int(input())
for j in range(N):
    instAs = As
    instAs.pop(j)
    print(max(instAs)

Fixed submission:
r = int(input())
print(3*r**2)
Buggy python submission (verdict: Time Limit Exceeded):
L, R = map(int, input().split())
modlist =[]
for i in range(L, R):
    for j in range(L+1,R+1):
        nummod = i * j % 2019
        modlist.append(nummod)
    if nummod == 0:
        break
print(min(modlist))

Fixed submission:
L, R = map(int, input().split())
modlist =[]
for i in range(L, R):
    for j in range(L+1,R+1):
        nummod = i * j % 2019
        modlist.append(nummod)
        if nummod == 0:
            break
    if nummod == 0:
        break
print(min(modlist))

Buggy python submission (verdict: Time Limit Exceeded):
L, R = map(int, input().split())
modlist =[]
for i in range(L, R):
    for j in range(L+1,R+1):
        nummod = i * j % 2019
        modlist.append(nummod)
        if nummod == 0:
            break
print(min(modlist))


Fixed submission:
L, R = map(int, input().split())
modlist =[]
for i in range(L, R):
    for j in range(L+1,R+1):
        nummod = i * j % 2019
        modlist.append(nummod)
        if nummod == 0:
            break
    if nummod == 0:
        break
print(min(modlist))
Buggy python submission (verdict: Runtime Error):
X = int(input())
X = 7 or X = 5 or X =3:
    print("YES")
else:
    print("NO")

Fixed submission:
X = int(input())
if X == 7 or X == 5 or X == 3:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
S = input()
if len(S) ==2:
    print(S)
else:
　print(S[::-1])


Fixed submission:
S = input()
if len(S) ==2:
    print(S)
else:
    print(S[::-1])
Buggy python submission (verdict: Runtime Error):
def gcd(a,b):
    if b > 0:
        c = a % b
        print(gcd(b,c))
    elif b == 0:
        print(a)

N, X = map(int,input().split())
x = list(input().split())
x = [abs(X-int(i)) for i in x]
for i in x:
    if i == x[0]:
        a = i
    else:
        a = gcd(a,i)
print(a)

Fixed submission:
def gcd(a,b):
    if b > 0:
        c = a % b
        return(gcd(b,c))
    elif b == 0:
        return(a)

N, X = map(int,input().split())
x = list(input().split())
x = [abs(X-int(i)) for i in x]
for i in x:
    if i == x[0]:
        a = i
    else:
        a = gcd(a,i)
print(a)

Buggy python submission (verdict: Runtime Error):
def gcd(a,b):
    if b > 0:
        c = a % b
        gcd(b,c)
    elif b == 0:
        print(a)

N, X = map(int,input().split())
x = list(input().split())
x = [abs(X-int(i)) for i in x]
for i in x:
    if i == x[0]:
        a = i
    else:
        a = gcd(a,i)
print(a)

Fixed submission:
def gcd(a,b):
    if b > 0:
        c = a % b
        return(gcd(b,c))
    elif b == 0:
        return(a)

N, X = map(int,input().split())
x = list(input().split())
x = [abs(X-int(i)) for i in x]
for i in x:
    if i == x[0]:
        a = i
    else:
        a = gcd(a,i)
print(a)

Buggy python submission (verdict: Runtime Error):
N, X = map(int,input().split())
x = list(input().split())
x = sorted([int(i) for i in x])
diff = []
res = 10**10
for i in x:
    if i !=x[0]:
        diff.append(i-old)
    res = min(abs(X-i),res)
    old = i
res = min(min(diff),res)
print(res)
    

Fixed submission:
def gcd(a,b):
    if b > 0:
        c = a % b
        return(gcd(b,c))
    elif b == 0:
        return(a)

N, X = map(int,input().split())
x = list(input().split())
x = [abs(X-int(i)) for i in x]
for i in x:
    if i == x[0]:
        a = i
    else:
        a = gcd(a,i)
print(a)
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
 
m = 1000000007
dp = [0] * 4
dp[0] = 1
 
for c in s:
    if c=='A':
        dp[1] += dp[0]
    elif c=='B':
        dp[2] += dp[1]
    elif c=='C':
        dp[3] += dp[2]
    elif c=='?':
        dp = [dp[0]*3, dp[0]+dp[1]*3, dp[1]+dp[2]*3, dp[2]+dp[3]*3]
print(dp[3]%m)
                

Fixed submission:
S = input()
def ABC(S):
    N = len(S)
    dp = [[0 for j in range(4)] for i in range(N+1)]
    model = 'ABC'
    p = 10**9 + 7
    for i in range(N, -1, -1):
        for j in range(3,-1,-1):
            if i == N and j == 3:
                dp[i][j] = 1
            elif i == N and j < 3:
                dp[i][j] = 0
            elif i < N and j == 3:
                if S[i] == '?':
                    dp[i][j] = 3 * dp[i+1][j] % p
                else:
                    dp[i][j] = dp[i+1][j] % p
            else:
                if S[i] == '?':
                    m1 = 3
                else:
                    m1 = 1
                if S[i] == '?' or S[i] == model[j]:
                    m2 = 1
                else:
                    m2 = 0
                dp[i][j] = (m1 * dp[i+1][j])%p + m2 * (dp[i+1][j+1])%p
    return dp[0][0] % p
print(ABC(S))

Buggy python submission (verdict: Time Limit Exceeded):
S = input()
def ABC(S):
    N = len(S)
    dp = [[0 for j in range(4)] for i in range(N+1)]
    model = 'ABC'
    for i in range(N, -1, -1):
        for j in range(3,-1,-1):
            if i == N and j == 3:
                dp[i][j] = 1
            elif i == N and j < 3:
                dp[i][j] = 0
            elif i < N and j == 3:
                if S[i] == '?':
                    dp[i][j] = 3 * dp[i+1][j]
                else:
                    dp[i][j] = dp[i+1][j]
            else:
                if S[i] == '?':
                    m1 = 3
                else:
                    m1 = 1
                if S[i] == '?' or S[i] == model[j]:
                    m2 = 1
                else:
                    m2 = 0
                dp[i][j] = m1 * dp[i+1][j] + m2 * dp[i+1][j+1]
    return dp[0][0] % (10**9 + 7)
print(ABC(S))

Fixed submission:
S = input()
def ABC(S):
    N = len(S)
    dp = [[0 for j in range(4)] for i in range(N+1)]
    model = 'ABC'
    p = 10**9 + 7
    for i in range(N, -1, -1):
        for j in range(3,-1,-1):
            if i == N and j == 3:
                dp[i][j] = 1
            elif i == N and j < 3:
                dp[i][j] = 0
            elif i < N and j == 3:
                if S[i] == '?':
                    dp[i][j] = 3 * dp[i+1][j] % p
                else:
                    dp[i][j] = dp[i+1][j] % p
            else:
                if S[i] == '?':
                    m1 = 3
                else:
                    m1 = 1
                if S[i] == '?' or S[i] == model[j]:
                    m2 = 1
                else:
                    m2 = 0
                dp[i][j] = (m1 * dp[i+1][j])%p + m2 * (dp[i+1][j+1])%p
    return dp[0][0] % p
print(ABC(S))
Buggy python submission (verdict: Runtime Error):
import math
N = int(input())
a = input().split()
a = [int(i) for i in a]
res_list = {}
def lcm(x,y):
    return (x * y) // math.gcd(x, y)
for i in range(len(a)):
    if i == 0:
        res = a[i]
        continue
    else:
        res = lcm(res,a[i])
res2 = 0
for i in a:
    res2 += (res-1) % i
print(res2)

Fixed submission:

N = int(input())
a = input().split()
a = [int(i) for i in a]
res_list = {}
def gcd(a,b):
    while b:
        a, b = b, a % b
    return a
def lcm(x,y):
    return (x * y) // gcd(x, y)
for i in range(len(a)):
    if i == 0:
        res = a[i]
        continue
    else:
        res = lcm(res,a[i])
res2 = 0
for i in a:
    res2 += (res-1) % i
print(res2)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = input().split()
a = [int(i) for i in a]
res_list = []
for i in range(10 ** 10):
    res = 0
    if i >= 2 and i% 2 == 0:
        if res_list[:i//2] == res_list[i//2:]:
            break
    for j in a:
        res += i % j
    res_list.append(res)
    
print(max(res_list))

Fixed submission:

N = int(input())
a = input().split()
a = [int(i) for i in a]
res_list = {}
def gcd(a,b):
    while b:
        a, b = b, a % b
    return a
def lcm(x,y):
    return (x * y) // gcd(x, y)
for i in range(len(a)):
    if i == 0:
        res = a[i]
        continue
    else:
        res = lcm(res,a[i])
res2 = 0
for i in a:
    res2 += (res-1) % i
print(res2)
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = list(input()) 
result_list = []
for i in range(N):    
    result_list.append(S[:i].count("W") + S[i+1:].count("E"))
print(min(result_list))

Fixed submission:
A, B = map(int, input().split())
print (max(A + B, A - B, A * B))
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = list(input()) 
result_list = [] 
for i in range(N): 
    X = S[:i] 
    Y = S[i:] 
    counter = 0 
    old_list = [] 
    for j in X: 
        if j in Y and not(j in old_list): 
            counter += 1 
            old_list.append(j) 
            result_list.append(counter) 
print (max(result_list))

Fixed submission:
N = int(input())
S = list(input()) 
result_list = [] 
for i in range(N): 
    X = S[:i] 
    Y = S[i:] 
    counter = 0 
    old_list = [] 
    for j in X: 
        if j in Y and not(j in old_list): 
            counter += 1 
            old_list.append(j) 
            result_list.append(counter) 
if result_list == []:
    print(0)
else:
    print (max(result_list))

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = list(map(int,input().split(""))) 
result_list = [] 
for i in range(N): 
    X = S[:i] 
    Y = S[i:] 
    counter = 0 
    old_list = [] 
    for j in X: 
        if j in Y and not(j in old_list): 
            counter += 1 
            old_list.append(j) 
            result_list.append(counter) 
print (max(result_list))

Fixed submission:
N = int(input())
S = list(input()) 
result_list = [] 
for i in range(N): 
    X = S[:i] 
    Y = S[i:] 
    counter = 0 
    old_list = [] 
    for j in X: 
        if j in Y and not(j in old_list): 
            counter += 1 
            old_list.append(j) 
            result_list.append(counter) 
if result_list == []:
    print(0)
else:
    print (max(result_list))

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = list(map(int,input().split())) 
result_list = [] 
for i in range(N): 
    X = S[:i] 
    Y = S[i:] 
    counter = 0 
    old_list = [] 
    for j in X: 
        if j in Y and not(j in old_list): 
            counter += 1 
            old_list.append(j) 
            result_list.append(counter) 
print (max(result_list))

Fixed submission:
N = int(input())
S = list(input()) 
result_list = [] 
for i in range(N): 
    X = S[:i] 
    Y = S[i:] 
    counter = 0 
    old_list = [] 
    for j in X: 
        if j in Y and not(j in old_list): 
            counter += 1 
            old_list.append(j) 
            result_list.append(counter) 
if result_list == []:
    print(0)
else:
    print (max(result_list))

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = list(map(int,input().split())) 
result_list = [] 
for i in range(N): 
    X = S[:i] 
    Y = S[i:] 
    counter = 0 
    old_list = [] 
    for j in X: 
        if j in Y and not(j in old_list): 
            counter += 1 old_list.append(j) 
            result_list.append(counter) 
print(max(result_list))

Fixed submission:
N = int(input())
S = list(input()) 
result_list = [] 
for i in range(N): 
    X = S[:i] 
    Y = S[i:] 
    counter = 0 
    old_list = [] 
    for j in X: 
        if j in Y and not(j in old_list): 
            counter += 1 
            old_list.append(j) 
            result_list.append(counter) 
if result_list == []:
    print(0)
else:
    print (max(result_list))
Buggy python submission (verdict: Runtime Error):
A,B,C,D,E,F= map(int, input().split())
res_dict = {}
x_list = []
for i in range(F // A + 1):
    for j in range((F - 100 * A * i) // B + 1):
        x = 100 * (i * A + j * B)
        if x <= F:
            x_list.append(x)
x_uniq = list(set(x_list))
for x in x_uniq:
    for i in range((F - x) // C + 1):
        for j in range((F - x - C * i ) // D + 1):
            y = i * C + j * D
            if x + y <= F and x + y != 0 and x != 0 and ((y / (x + y) <= (E / (100 + E)))):
                res_dict[x] = y
res_dict2 = {}
for i in res_dict:
    res_dict2[res_dict[i]/i] = i
print(res_dict)
print("{0} {1}".format(int(((1 + max(res_dict2))*res_dict2[max(res_dict2)])),int(max(res_dict2)*res_dict2[max(res_dict2)])))

Fixed submission:
N = int(input())
A = int(input())
print(N**2-A)