Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = []
for i in range(n):
  a.append(int(input()))
print(sum(a) - len(a))

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

res = sum([i-1 for i in a])
print(res)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
az = [0] * n
c = 0
for i in range(n)[::-1]:
    if a[i] == 0:
        c += 1
        az[i] = c
    else:
        c = 0
res = 0
for i in range(n):
    res += 1
    total = a[i]
    c = 1
    while c <= n - i - 1:
        if az[i+c] != 0:
            res += az[i+c]
            c += az[i+c]
            continue
        tmp = total ^ a[i+c]
        if total + a[i+c] == tmp:
            res += 1
            total = tmp
        else:
            break
        c += 1
print(res)

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

ans, r = 0, 0
SUM, XOR = 0, 0

for l in range(N):
    while (r < N) and (SUM + A[r] == XOR ^ A[r]):
        SUM += A[r]
        XOR ^= A[r]
        r += 1

    ans += (r - l)
    SUM -= A[l]
    XOR ^= A[l]
print(ans)
Buggy python submission (verdict: Runtime Error):
h, w = map(int, input().split())
s = [list(input()) for _ in range(h)]
for i in range(h):
    for j in range(w):
        if s[i][j] == "#":
            f = False
            if 0 <= j+1 < h and 0 <= i < w and s[i][j+1] == "#":
                f = True
            if 0 <= j-1 < h and 0 <= i < w and s[i][j-1] == "#":
                f = True
            if 0 <= j < h and 0 <= i+1 < w and s[i+1][j] == "#":
                f = True
            if 0 <= j < h and 0 <= i-1 < w and s[i-1][j] == "#":
                f = True
            if not f:
                print("No")
                exit()
print("Yes")

Fixed submission:
h, w = map(int, input().split())
s = [list(input()) for _ in range(h)]
if h == 1 and w == 1:
    print("Yes")
    exit()

for i in range(h):
    for j in range(w):
        if s[i][j] == "#":
            f = False
            if 0 <= i+1 < h and 0 <= j < w and s[i+1][j] == "#":
                f = True
            if 0 <= i-1 < h and 0 <= j < w and s[i-1][j] == "#":
                f = True
            if 0 <= i < h and 0 <= j+1 < w and s[i][j+1] == "#":
                f = True
            if 0 <= i < h and 0 <= j-1 < w and s[i][j-1] == "#":
                f = True
            if not f:
                print("No")
                exit()
print("Yes")
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 or b-k < i:
        print(i)


Fixed submission:
a, b, k = map(int, input().split())
l = []
for i in range(a, min(a+k, b+1)):
    l.append(i)
for i in range(max(a, b-k+1), b+1):
    l.append(i)
l = sorted(set(l))
for i in l:
    print(i)
Buggy python submission (verdict: Runtime Error):
a = int(inpu())
b = int(inpu())
c = int(inpu())
x = int(inpu())
res = 0
for i in range(a):
  for j in range(b):
    for k in range(c):
      total = i * 500 + j * 100 + c * 50
      if total == x:
        res += 1
print(res)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
res = 0
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      total = i*500 + j*100 + k*50
      if total == x:
        res += 1
print(res)

Buggy python submission (verdict: Runtime Error):
a = int(inpu())
b = int(inpu())
c = int(inpu())
x = int(inpu())
res = 0
for i in range(a):
  for j in range(b):
    for k in range(c):
      total = i * 500 + j * 100 + c * 50
      if total == x:
        res += 1

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
res = 0
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      total = i*500 + j*100 + k*50
      if total == x:
        res += 1
print(res)
Buggy python submission (verdict: Runtime Error):
s = input()
print(s.count("1!)

Fixed submission:
s = input()
print(s.count("1"))
Buggy python submission (verdict: Runtime Error):
i = int(input())
num = map(int, input().split())
count = 0
while True:
  for k in range(i):
    num[k] /= 2
    if type(num[k]) is float:
      break
  count += 1
print(count)


Fixed submission:
i = int(input())
num = list(map(int, input().split()))
count = 0
while True:
  flag = False
  for k in range(i):
    if num[k] % 2 != 0:
      flag = True
  if flag:
    break
  for k in range(i):
    num[k] /= 2
  count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
i = int(input())
num = map(int, input().split())
count = 0
while True:
  for k in range(i):
    num[k] =/ 2
    if type(num[k]) is float or num[k] == 0:
      break
    count += 1
print(count)


Fixed submission:
i = int(input())
num = list(map(int, input().split()))
count = 0
while True:
  flag = False
  for k in range(i):
    if num[k] % 2 != 0:
      flag = True
  if flag:
    break
  for k in range(i):
    num[k] /= 2
  count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
i = int(input())
num = map(int, input().split())
count = 0
while True:
  for k in range(i):
    num[k] = num[k] / 2
    if type(num[k]) is float:
      break
    count += 1
print(count)


Fixed submission:
i = int(input())
num = list(map(int, input().split()))
count = 0
while True:
  flag = False
  for k in range(i):
    if num[k] % 2 != 0:
      flag = True
  if flag:
    break
  for k in range(i):
    num[k] /= 2
  count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
i = int(input())
num = map(int, input().split())
count = 0
while True:
  if type(sum(num/2)) is float:
    break
  count += 1
print(count)


Fixed submission:
i = int(input())
num = list(map(int, input().split()))
count = 0
while True:
  flag = False
  for k in range(i):
    if num[k] % 2 != 0:
      flag = True
  if flag:
    break
  for k in range(i):
    num[k] /= 2
  count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
i = int(input())
num = map(int, input().split())
count = 0
while True:
  if(type(sum(num/2)) == "float"):
    break
  count += 1
print(count)

Fixed submission:
i = int(input())
num = list(map(int, input().split()))
count = 0
while True:
  flag = False
  for k in range(i):
    if num[k] % 2 != 0:
      flag = True
  if flag:
    break
  for k in range(i):
    num[k] /= 2
  count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
n = int(input())
f = [list(map(int, input().split())) for _ in range(n)]
p = [list(map(int, input().split())) for _ in range(n)]
res = -10**10
for i in range(1, 1<<10):
    count = [0 for _ in range(10)]
    for j in range(10):
        for k in range(n):
            if (i>>j)&1 == 1 and f[k][j] == 1:
                count[k] += 1
    total = 0
    for k in range(n):
        total += p[k][count[k]]
    res = max(res, total)
print(res)


Fixed submission:
n = int(input())
f = [list(map(int, input().split())) for _ in range(n)]
p = [list(map(int, input().split())) for _ in range(n)]
res = -10**10
for i in range(1, 1<<10):
    count = [0 for _ in range(n)]
    for j in range(10):
        for k in range(n):
            if (i>>j)&1 == 1 and f[k][10-j-1] == 1:
                count[k] += 1
    total = 0
    for k in range(n):
        total += p[k][count[k]]
    res = max(res, total)
print(res)
Buggy python submission (verdict: Time Limit Exceeded):
import bisect
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
asort = sorted(a)
bsort = sorted(b)
csort = sorted(c)
res = 0
for ai in a:
    bindex = bisect.bisect_right(bsort, ai)
    if bindex == n:
        continue
    for bi in bsort[bindex:]:
        cindex = bisect.bisect_right(csort, bi)
        if cindex == n:
            continue
        res += n-cindex
print(res)

Fixed submission:
import bisect
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
bsort = sorted(b)
csort = sorted(c)
res = 0
asum = [0] * n
bsum = [0] * n
for i in range(n):
    asum[i] = n - bisect.bisect_right(bsort, a[i])
for i in range(n):
    bsum[i] = n - bisect.bisect_right(csort, b[i])
bsum.sort()
total = 0
for i in range(n):
    total += bsum[i]
    bsum[i] = total
res = 0
for i in range(n):
    if asum[i] != 0:
        res += bsum[asum[i] -1]
print(res)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
aset = set(a)
aset = sorted(aset, reverse = True)
res = 0
for i in aset:
    count = a.count(i)
    if count >= 4 and res == 0:
        print(i*i)
        exit()
    elif count >= 2 and res == 0:
        res = i
    elif count >= 2:
        print(res * i)
        exit()
print(res)


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
aset = set(a)
d = {i:0 for i in aset}
for i in range(n):
    d[a[i]] += 1

res = 0
for k, i in sorted(d.items(), reverse = True):
    if i >= 4 and res == 0:
        print(k*k)
        exit()
    elif i >= 2 and res == 0:
        res = k
    elif i >= 2:
        print(res * k)
        exit()
print(res)
Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(200000000)
n = int(input())

if n == 1:
    print(t[0])
    exit()
# 最大公約数
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a%b)
# 最小公倍数
def lcm(a, b):
    return a * b / gcd(a, b)
res = 1
for i in range(n):
    t = int(input())
    res = int(lcm(res, t))
print(res)

Fixed submission:
n = int(input())
t = [int(input()) for _ in range(n)]

# 最大公約数
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a%b)
# 最小公倍数
def lcm(a, b):
    return a * b // gcd(a, b)
res = 1
for i in range(n):
    res = lcm(res, t[i])
print(res)

Buggy python submission (verdict: Runtime Error):
n = int(input())
t = [int(input()) for _ in range(n)]

if n == 1:
    print(t[0])
    exit()
# 最大公約数
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a%b)
# 最小公倍数
def lcm(a, b):
    return a * b / gcd(a, b)
res = int(lcm(t[0], t[1]))
for i in range(2, n):
    res = int(lcm(res, t[i]))
print(res)


Fixed submission:
n = int(input())
t = [int(input()) for _ in range(n)]

# 最大公約数
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a%b)
# 最小公倍数
def lcm(a, b):
    return a * b // gcd(a, b)
res = 1
for i in range(n):
    res = lcm(res, t[i])
print(res)

Buggy python submission (verdict: Runtime Error):
n = int(input())
t = [int(input()) for _ in range(n)]

if n == 1:
    print(t[0])
    exit()
# 最大公約数
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a%b)
# 最小公倍数
def lcm(a, b):
    return a * b / gcd(a, b)
res = lcm(t[0], t[1])
for i in range(2, n):
    res = lcm(res, t[i])
print(int(res))


Fixed submission:
n = int(input())
t = [int(input()) for _ in range(n)]

# 最大公約数
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a%b)
# 最小公倍数
def lcm(a, b):
    return a * b // gcd(a, b)
res = 1
for i in range(n):
    res = lcm(res, t[i])
print(res)
Buggy python submission (verdict: Runtime Error):
w, a, b = map(int, input().split())
if abs(a-b) <= w:
    print(0)
else:
    print(min(abs(b-a-w), abs(a-b-w))

Fixed submission:
w, a, b = map(int, input().split())
if abs(a-b) <= w:
    print(0)
else:
    print(min(abs(b-a-w), abs(a-b-w)))
Buggy python submission (verdict: Time Limit Exceeded):
import sys


def solve(N: int, S: "List[str]"):

    kuji = []

    for s in S:

        if s not in kuji:
            kuji.append(s)

    print(len(kuji))

    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    S = [next(tokens) for _ in range(N)]  # type: "List[str]"
    solve(N, S)

if __name__ == '__main__':
    main()


Fixed submission:
import sys


def solve(N: int, S: "List[str]"):

    S = set(S)

    print(len(S))

    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    S = [next(tokens) for _ in range(N)]  # type: "List[str]"
    solve(N, S)

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

mo=10**9+7
an=0
wk=0
for i in range(n-1):
    for j in range(i+1,n):
        wk+=(a[j]%mo)
    an+=(a[i]*(wk%mo))%mo
    an%=mo
    wk=0
print(an)

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

mo=10**9+7
an=0
wk=0
ru=[]
for i in a:
    wk+= i
    ru.append(wk%mo)
for i in range(n-1):
    an+=a[i]*(ru[n-1]-ru[i])
    an%=mo

print(an)

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

mo=10**9+7
an=0
for i in range(n-1):
    for j in range(i+1,n):
        an+=(a[i]%mo)*(a[j]%mo)
        an%=mo
print(an)

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

mo=10**9+7
an=0
wk=0
ru=[]
for i in a:
    wk+= i
    ru.append(wk%mo)
for i in range(n-1):
    an+=a[i]*(ru[n-1]-ru[i])
    an%=mo

print(an)
Buggy python submission (verdict: Runtime Error):
x,k,d=map(int,(input().split()))

zx=x
if abs(x)<d*k:
    wk,x=divmod(abs(x),d)
    k-=wk    
else:
    abs(x)-=d*k
    k=0

for i in range(k):
    xm=abs(x+d)
    xu=abs(x-d)
    x=min(xm,xu)
    k-=1
    if zx+x==d:
        if k%2!=0:
            x=zx
            break
        else:
            break
    zx=x
    
print(x)

Fixed submission:
x,k,d=map(int,(input().split()))

x=abs(x)
zx=x
if x<d*k:
    wk,x=divmod(abs(x),d)
    k-=wk    
else:
    x-=d*k
    k=0

for i in range(k):
    xm=abs(x+d)
    xu=abs(x-d)
    x=min(xm,xu)
    k-=1
    if zx+x==d:
        if k%2!=0:
            x=zx
            break
        else:
            break
    zx=x
    
print(x)

Buggy python submission (verdict: Time Limit Exceeded):
x,k,d=map(int,(input().split()))

zx=x
#zzx=zx
for i in range(k):
    xm=abs(x+d)
    xu=abs(x-d)
    x=min(xm,xu)
    k-=1
    if zx+x==d:
        if k%2!=0:
            x=zx
            break
        else:
#            x=zx
            break
#    zzx=zx
    zx=x
    
print(x)      

Fixed submission:
x,k,d=map(int,(input().split()))

x=abs(x)
zx=x
if x<d*k:
    wk,x=divmod(abs(x),d)
    k-=wk    
else:
    x-=d*k
    k=0

for i in range(k):
    xm=abs(x+d)
    xu=abs(x-d)
    x=min(xm,xu)
    k-=1
    if zx+x==d:
        if k%2!=0:
            x=zx
            break
        else:
            break
    zx=x
    
print(x)
Buggy python submission (verdict: Runtime Error):
n = int(input())

nn=n
i=1
while nn >26**i:
    i+=1
    nn-=26**i

an=['a']*i
j=0
while n:
    n-=1
    wk=n%26
    an[j]=(chr(ord('a')+wk))
    n= n//26
    j+=1
    
an.reverse()
print(''.join(an))

Fixed submission:
n = int(input())

nn=n
i=1
while nn > 26**i:
    nn-=26**i
    i+=1

an=['a']*i
j=0
while n:
    n-=1
    wk=n%26
    an[j]=(chr(ord('a')+wk))
    n = n//26
    j+=1
    
an.reverse()
print(''.join(an))

Buggy python submission (verdict: Runtime Error):
import sys
n = int(input())

an =[]

for i in range(11):
    if 26**(10-i)<=n and i<=10:
        wk = n//26**(10-i)
        n=n%26**(10-i)
        an.append(chr(wk%26+96))
    else:
        an.append(chr(n+96))
print(''.join(an))

Fixed submission:
n = int(input())

nn=n
i=1
while nn > 26**i:
    nn-=26**i
    i+=1

an=['a']*i
j=0
while n:
    n-=1
    wk=n%26
    an[j]=(chr(ord('a')+wk))
    n = n//26
    j+=1
    
an.reverse()
print(''.join(an))
Buggy python submission (verdict: Runtime Error):
a,b =map(float,input().split())
b=b*100

print((a*int(b)//100)

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

print(int(a*b))
Buggy python submission (verdict: Runtime Error):
def fc(n):
    wk =0
    h=0
    for i in range(2,int(n**0.5)+1):
        if n%i==0:
            wk+=1
            n//=i
            h=i
    if n!=1 and h < n:
        wk+=1
    return wk
 
n =int(input()

Fixed submission:
def fc(n):
    wk =0
    for i in range(2,int(n**0.5)):
        j=i
        while n%j == 0:
            wk+=1
            n//=j 
            j*=i
        while n%i==0:
            n//=i
            continue
    if n!=1:
        wk+=1
    return wk

n =int(input())
print(fc(n))

Buggy python submission (verdict: Runtime Error):
def fc(n):
    wk =0
    h=0
    for i in range(2,int(n**0.5)+1):
        if n%i==0:
            wk+=1
            n//=i
            h=i
    if n!=1 and h <
     n:
        wk+=1
    return wk

n =int(input())

print(fc(n))

Fixed submission:
def fc(n):
    wk =0
    for i in range(2,int(n**0.5)):
        j=i
        while n%j == 0:
            wk+=1
            n//=j 
            j*=i
        while n%i==0:
            n//=i
            continue
    if n!=1:
        wk+=1
    return wk

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

for i in a:
    al[a[i]-1] += 1
for i in range(n):
    print(al[i])

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
al = [0 for i in range(n)]

for i in a:
    al[i-1] += 1
for i in range(n):
    print(al[i])

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

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
al = [0 for i in range(n)]

for i in a:
    al[i-1] += 1
for i in range(n):
    print(al[i])

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

def main():
    n = int(input())
    a = np.array(list(map(int,input().split())))

    [print(np.count_nonzero(a==i)) for i in range(1,n+1)]

main()

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
al = [0 for i in range(n)]

for i in a:
    al[i-1] += 1
for i in range(n):
    print(al[i])

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

n = int(input())
a = np.array(list(map(int,input().split())))

[print(np.count_nonzero(a==i)) for i in range(1,n+1)]

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
al = [0 for i in range(n)]

for i in a:
    al[i-1] += 1
for i in range(n):
    print(al[i])

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

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
al = [0 for i in range(n)]

for i in a:
    al[i-1] += 1
for i in range(n):
    print(al[i])

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

an=([a.count(i) for i in range(1,n+1)])
for i in range(n):
    print(an[i])

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
al = [0 for i in range(n)]

for i in a:
    al[i-1] += 1
for i in range(n):
    print(al[i])

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

an = []
for i in range(1,n+1):
    print(a.count(i))

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
al = [0 for i in range(n)]

for i in a:
    al[i-1] += 1
for i in range(n):
    print(al[i])
Buggy python submission (verdict: Time Limit Exceeded):
import math

def gcd3(a,b,c):
    return(math.gcd(math.gcd(a,b),c))

k = int(input())

print(sum([gcd3(a,b,c) for a in range(k,0,-1)
 for b in range(k,0,-1)
 for c in range(k,0,-1)]))

Fixed submission:
from math import gcd

def gcd3(a,b,c):
    return(gcd(gcd(a,b),c))

k = int(input())

print(sum([gcd3(a,b,c) for a in range(1,k+1)
 for b in range(1,k+1)
 for c in range(1,k+1)]))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()

an = s.count('R') *s.count('G') *s.count('B')

for i in range(n-2):
    for j in range(i+1,n-1):
        for k in range(j+1,n):
            if ((i-j)==(j-k)) and (s[i]!=s[j]) and (s[j]!=s[k])and(s[i]!=s[k]):
                an -= 1

print(an)

Fixed submission:
n = int(input())
s = input()

an = s.count('R') *s.count('G') *s.count('B')

for i in range(n-2):
    for j in range(i+1,n-1):
        k = 2*j-i
        if (k<n) and (s[i]!=s[j]) and (s[j]!=s[k])and(s[i]!=s[k]):
                an -= 1

print(an)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()

anl =[]
print(len([anl for i in range(1,n+1)
 for j in range(i+1,n+1)
 for k in range(j+1,n+1)
 if s[i-1]!=s[k-1]
 if s[j-1]!=s[k-1] 
 if s[i-1]!=s[j-1]
 if i<j and j<k and (j-i) != (k-j)]))

Fixed submission:
n = int(input())
s = input()

an = s.count('R') *s.count('G') *s.count('B')

for i in range(n-2):
    for j in range(i+1,n-1):
        k = 2*j-i
        if (k<n) and (s[i]!=s[j]) and (s[j]!=s[k])and(s[i]!=s[k]):
                an -= 1

print(an)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()

an = 0
anl =[]
print(len([anl for i in range(1,n+1)
 for j in range(i+1,n+1)
 for k in range(j+1,n+1)
  if i<j and j<k and (j-i) != (k-j) and s[i-1]!=s[j-1] and s[i-1]!=s[k-1] and s[j-1]!=s[k-1]]))

Fixed submission:
n = int(input())
s = input()

an = s.count('R') *s.count('G') *s.count('B')

for i in range(n-2):
    for j in range(i+1,n-1):
        k = 2*j-i
        if (k<n) and (s[i]!=s[j]) and (s[j]!=s[k])and(s[i]!=s[k]):
                an -= 1

print(an)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()

an = 0

for i in range(1,n+1):
    for j in range(i+1,n+1):
        for k in range(j+1,n+1):
            if i<j and j<k and (j-i) != (k-j) and s[i-1]!=s[j-1] and s[i-1]!=s[k-1] and s[j-1]!=s[k-1]:
                an += 1
print(an)

Fixed submission:
n = int(input())
s = input()

an = s.count('R') *s.count('G') *s.count('B')

for i in range(n-2):
    for j in range(i+1,n-1):
        k = 2*j-i
        if (k<n) and (s[i]!=s[j]) and (s[j]!=s[k])and(s[i]!=s[k]):
                an -= 1

print(an)
Buggy python submission (verdict: Runtime Error):
b = s[:m]

for i in range(int(m/2)):
    if b[i:(i+1)] != b[(m-i-1):m-i]:
        print('No')
        sys.exit()
m = int((n+3)/2)
b = s[m-1:]
m= len(b)
for i in range(int(m/2)):
    if b[i:(i+1)] != b[(m-i-1):m-i]:
        print('No')
        sys.exit()
print('Yes')

Fixed submission:
import sys
s = input()

n = len(s)
m = int((n-1)/2)
b = s[:m]

for i in range(int(m/2)):
    if b[i:(i+1)] != b[(m-i-1):m-i]:
        print('No')
        sys.exit()
m = int((n+3)/2)
b = s[m-1:]
m= len(b)
for i in range(int(m/2)):
    if b[i:(i+1)] != b[(m-i-1):m-i]:
        print('No')
        sys.exit()
for i in range(int(n/2)):
    if s[i:(i+1)] != s[(n-i-1):n-i]:
        print('No')
        sys.exit()  
print('Yes')
Buggy python submission (verdict: Runtime Error):
import math

a,b = map(int,input().split())

motob = b/0.1
a += 0.999
xmotoa = a/0.08

print(xmotoa,xmotob)
if xmotoa >= motob:
    print(math.ceil(motoa))
else:
    print('-1')

Fixed submission:
import math

a,b = map(int,input().split())

motoa = a/0.08

motob = b/0.1
a += 1
b += 1
xmotoa = a/0.08
xmotob = b/0.1

if motoa < motob <xmotoa:
    print(math.ceil(motob))
elif motoa < xmotob <xmotoa:
    print(math.ceil(motoa))
else:
    print('-1')