Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
numbers = list(map(int,input().split()))

if 0 in numbers:
  print("0")
else:
 result=1
 for n in numbers:
    result *= n
 if result > 10**18:
  result = -1
 print(result)

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

if 0 in numbers:
  print("0")
else:
 result=1
 for n in numbers:
    result *= n
    if result > 10**18:
      result = -1
      break
 print(result)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
numbers = map(int,input().split())

result=1
for n in numbers:
  result *= n
  
if result > 10**18:
  result = -1
  
print(result)



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

if 0 in numbers:
  print("0")
else:
 result=1
 for n in numbers:
    result *= n
    if result > 10**18:
      result = -1
      break
 print(result)
Buggy python submission (verdict: Runtime Error):
r = int(input())
print r*r


Fixed submission:
r=int(input())
print(r*r)

Buggy python submission (verdict: Runtime Error):
r = int(input())
return r * r


Fixed submission:
r=int(input())
print(r*r)

Buggy python submission (verdict: Runtime Error):
r = int(str.input())
return r * r




Fixed submission:
r=int(input())
print(r*r)
Buggy python submission (verdict: Runtime Error):
n=int(input())

if n>=30:
	print("Yes)

else:
	print("No")

Fixed submission:
n=int(input())

if n>=30:
	print("Yes")

else:
	print("No")
Buggy python submission (verdict: Runtime Error):
N = int(input())
if (N % 1000) != 0:
    ans = 1000 - N % 1000
elif:
    ans = 0
print(ans)

Fixed submission:
N = int(input())
if (N % 1000) != 0:
    ans = 1000 - N % 1000
else:
    ans = 0
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
A = sorted(A, reverse = True)

L = len(P) // 2

if len(A) % 2 == 0:
    #偶数の時
    ans = sum(A[:L]) + sum(A[1:L])
else:
    #奇数の時
    ans = sum(A[:L]) + sum(A[1:L+1])

print(ans)


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

L = len(A) // 2

if len(A) % 2 == 0:
    #偶数の時
    ans = sum(A[:L]) + sum(A[1:L])
else:
    #奇数の時
    ans = sum(A[:L]) + sum(A[1:L+1])

print(ans)
Buggy python submission (verdict: Runtime Error):
r = input()
ans = r *= 2
print(ans)

Fixed submission:
r = int(input())
ans = r ** 2
print(ans)

Buggy python submission (verdict: Runtime Error):
r = input()
ans = rˆ2
print(ans)

Fixed submission:
r = int(input())
ans = r ** 2
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = map(int,input().split())
print('{:.16g}'.format(1/sum(1/x for x in a)))

Fixed submission:
a = int(input())
s = input()
if a >= 3200:
  print(s)
else:
  print("red")

Buggy python submission (verdict: Runtime Error):
n = int(input())
numbers = []
i = 0
while i <= n:
  numbers.append(int(input()))
  i += 1

j = 0
s = 0
while n >= j:
  s += 1/numbers[j]
  i += 1

print(1/s)

Fixed submission:
a = int(input())
s = input()
if a >= 3200:
  print(s)
else:
  print("red")
Buggy python submission (verdict: Runtime Error):
n = int(input())
number = map(int,input().split())
print('{:.16g}').format(1/x for x in number)



Fixed submission:
n = int(input())
a = map(int, input().split())
print('{:.16g}'.format(1/sum(1/x for x in a)))

Buggy python submission (verdict: Runtime Error):
n = int(input())
numbers = []
i = 0
while i <= n:
  numbers.append(int(input()))
  i += 1

j = 0
s = 0
while n >= j:
  s += 1/numbers[j]
  j += 1

print(1/s)

Fixed submission:
n = int(input())
a = map(int, input().split())
print('{:.16g}'.format(1/sum(1/x for x in a)))

Buggy python submission (verdict: Runtime Error):
n = int(input())
numbers = []
for number in numbers:
  numbers.append(int(input))

i = 0
s = 0
while i >= n:
  s += 1/numbers[i]
  i += 1

print(1/s)

Fixed submission:
n = int(input())
a = map(int, input().split())
print('{:.16g}'.format(1/sum(1/x for x in a)))
Buggy python submission (verdict: Runtime Error):
n = map(int, input().split())
print(max(sum(n), n(0)-n(1), n(0)*n(1)))

Fixed submission:
n = list(int(i) for i in input().split())
print(max(sum(n), n[0]-n[1], n[0]*n[1]))
Buggy python submission (verdict: Runtime Error):
N = int(input())
L = list(map(int, int(input())))
L.sort()
if L[-1] > (sum(L) - L[-1]):
    print("Yes")
else:
    print("No")

Fixed submission:
N = int(input())
L = list(map(int, input().split()))
L.sort()
if L[-1] < (sum(L) - L[-1]):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
k = int(input())
x = 7%k
i = 1
for i in range(0,k+1):
    if x==0:
        print(i)
        break    
        
    l.append(x)
    x = (x*10+7)%k
    i += 1

Fixed submission:
k = int(input())
x = 7%k
i = 1
for i in range(1,k+1):
    if x==0:
        break    
    x = (x*10+7)%k
    i += 1
    
if x == 0:
    print(i)
else:
    print('-1')

Buggy python submission (verdict: Time Limit Exceeded):
k = int(input())
x = 7%k
l = []
i = 1
while(True):
    if x in l:
        print('-1')
        break
    if x==0:
        print(i)
        break    
        
    l.append(x)
    x = (x*10+7)%k
    i += 1

Fixed submission:
k = int(input())
x = 7%k
i = 1
for i in range(1,k+1):
    if x==0:
        break    
    x = (x*10+7)%k
    i += 1
    
if x == 0:
    print(i)
else:
    print('-1')

Buggy python submission (verdict: Runtime Error):
k = int(Input)
x = 7%k
l = []
i = 1
while(True):
    if x in l:
        print('-1')
        break
    if x==0:
        print(i)
        break    
        
    l.append(x)
    x = (x*10+7)%k
    i += 1

Fixed submission:
k = int(input())
x = 7%k
i = 1
for i in range(1,k+1):
    if x==0:
        break    
    x = (x*10+7)%k
    i += 1
    
if x == 0:
    print(i)
else:
    print('-1')
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
import sys
sysinput = sys.stdin.readline

N = int(sysinput())
P = np.array(list(map(int, sysinput().split())))

i_count = 1
for i in range(1, N):
  if (P[:i] < P[i]).any() == False:
    i_count +=1
  
print(i_count)

Fixed submission:
import sys
sysinput = sys.stdin.readline

N = int(sysinput())
P = list(map(int, sysinput().split()))
memo_mini = N
i_count = 0
for i in range(0, N):
  if memo_mini >= P[i]:
      i_count +=1
      memo_mini = P[i]
  else:
    pass
  
print(i_count)

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

N = int(input())
P = np.array(list(map(int, input().split())))

i_count = 1
for i in range(1, N):
  if (P[:i] < P[i]).any() == False:
    i_count +=1
  
print(i_count)

Fixed submission:
import sys
sysinput = sys.stdin.readline

N = int(sysinput())
P = list(map(int, sysinput().split()))
memo_mini = N
i_count = 0
for i in range(0, N):
  if memo_mini >= P[i]:
      i_count +=1
      memo_mini = P[i]
  else:
    pass
  
print(i_count)

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

i_count = 0
flag = True
for i in range(N):
  flag = True
  for j in range(i):
    if P[i] > P[j]:
      flag = False
      break

  if flag:
    i_count+=1

print(i_count)
  
	

Fixed submission:
import sys
sysinput = sys.stdin.readline

N = int(sysinput())
P = list(map(int, sysinput().split()))
memo_mini = N
i_count = 0
for i in range(0, N):
  if memo_mini >= P[i]:
      i_count +=1
      memo_mini = P[i]
  else:
    pass
  
print(i_count)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
H = [i for i in map(int, input().split())]
ans ='Yes'
for idx in range(N):
  k = H[idx]
  for j in range(idx+1, N):
    if k - H[j] > 1:
      ans = 'No'
print(ans)
    

Fixed submission:
N = int(input())
H = [i for i in map(int, input().split())]
ans ='Yes'
temp_max =H[0]
for idx in range(N):
  if temp_max - H[idx] > 1:
    ans = 'No'
    break
    
  if temp_max < H[idx]:
    temp_max=H[idx]
  
print(ans)
Buggy python submission (verdict: Runtime Error):
from fractions import gcd
A,B,C,D = map(int, input().split())

A =A-1
CD = int(C * D / gcd(C, D))
num_A_C = int(A / C)
num_A_D = int(A / D)
num_A_CD = int(A / CD)
num_B_C = int(B / C)
num_B_D = int(B / D)
num_B_CD = int(B / CD)

num_C =num_B_C - num_A_C
num_D =num_B_D - num_A_D
num_CD =num_B_CD - num_A_CD

ans = B - A -num_C - num_D + num_CD
print(ans)

Fixed submission:
s = input()
flag = False
for i in range(len(s)-1):
    if int(s[i]) == int(s[i+1]):
        flag = True

if flag:
    print('Bad')
else:
    print('Good')

Buggy python submission (verdict: Runtime Error):
flag = False
for i in range(len(s)-1):
    if int(s[i]) == int(s[i+1]):
        flag = True

if flag:
    print('Bad')
else:
    print('Good')

Fixed submission:
s = input()
flag = False
for i in range(len(s)-1):
    if int(s[i]) == int(s[i+1]):
        flag = True

if flag:
    print('Bad')
else:
    print('Good')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = []
B = []
for i  in range(N):
  a, b = map(int, input().split())
  A.append(a)
  B.append(b)

now_time = 0
flag = True
for i in range(N):
  min_b = min(B)
  min_b_idx = B.index(min_b)
  now_time += A[min_b_idx]
  del B[min_b_idx]
  del A[min_b_idx]
  if now_time > min_b:
    flag = False
if flag:
  print('Yes')
else:
  print('No')

Fixed submission:
import sys
from operator import itemgetter
sysinput = sys.stdin.readline

N = int(sysinput())
A = []

# O(N)
for i  in range(N):
  A.append(list(map(int, sysinput().split())))

A.sort(key=itemgetter(1))

now_time = 0
flag = True
for i in range(N):
  min_b = A[i][1]
  now_time += A[i][0]
  if now_time > min_b:
    flag = False
if flag:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
ans_list = [0]*(10**4)
for i in range(1, 100):
  for j in range(1, 100):
    for k in range(1, 100):
      ans = i**2 + j**2 + k**2 + i*j + j*k + k*i
      ans_list[ans-1] += 1
for i in ans_list[:n]:
  print(i)

Fixed submission:
from collections import Counter
n = int(input())
ans_list = [0]*(10**6)
for i in range(1, 100):
  for j in range(1, 100):
    for k in range(1, 100):
      ans = i**2 + j**2 + k**2 + i*j + j*k + k*i
      ans_list[ans-1] += 1
for i in ans_list[:n]:
  print(i)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
a = sorted(a, reverse=True)
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]
ans = 0
if a[-2] == a[-1]:
  ans -= 1
for i, num in enumerate(a):
  b = make_divisors(num)
  if set(a[i+1:]).isdisjoint(set(b)):
    ans += 1
print(ans)


Fixed submission:
from collections import deque
n = int(input())
a = list(map(int, input().split()))
a.sort()
a = deque(a)
b = [0]*(10**6 +1)
ans = 0
for _ in range(n):
  x = a.popleft()
  if b[x] == 0:
    ans += 1
    b[x] = 2
    tmp = 2 * x
    while tmp <= 10**6:
      b[tmp] = 1
      tmp += x
  elif b[x] == 2:
    ans -=1
    b[x] = 1
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
a = sorted(a, reverse=True)
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]
ans = 0
if a[-2] == a[-1]:
  ans -= 1
for i, num in enumerate(a):
  b = make_divisors(num)
  if set(a[i+1:]).isdisjoint(set(b)):
    ans += 1
print(ans)


Fixed submission:
from collections import deque
n = int(input())
a = list(map(int, input().split()))
a.sort()
a = deque(a)
b = [0]*(10**6 +1)
ans = 0
for _ in range(n):
  x = a.popleft()
  if b[x] == 0:
    ans += 1
    b[x] = 2
    tmp = 2 * x
    while tmp <= 10**6:
      b[tmp] = 1
      tmp += x
  elif b[x] == 2:
    ans -=1
    b[x] = 1
print(ans)
Buggy python submission (verdict: Runtime Error):
x = int(input())
a = []
for i in range(-50, 50):
  for j in range(-50, 50):
    if i**5 - j**5 == x:
      a.append([i, j])
      break
      
print(*a[0])

Fixed submission:
x = int(input())
a = []
for i in range(-200, 200):
  for j in range(-200, 200):
    if i**5 - j**5 == x:
      a.append([i, j])
      break
      
print(*a[0])

Buggy python submission (verdict: Runtime Error):
x = int(input())
a = []
for i in range(-90, 90):
  for j in range(-90, 90):
    if i**5 - j**5 == x:
      a.append([i, j])
      break
      
print(*a[0])

Fixed submission:
x = int(input())
a = []
for i in range(-200, 200):
  for j in range(-200, 200):
    if i**5 - j**5 == x:
      a.append([i, j])
      break
      
print(*a[0])

Buggy python submission (verdict: Runtime Error):
x = int(input())
a = []
for i in range(-100, 100):
  for j in range(-100, 100):
    if i**5 - j**5 == x:
      a.append([i, j])
      break
      
print(*a[0])

Fixed submission:
x = int(input())
a = []
for i in range(-200, 200):
  for j in range(-200, 200):
    if i**5 - j**5 == x:
      a.append([i, j])
      break
      
print(*a[0])

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
h = list(map(int, input().split()))
a = [0]*n
ans = n
for i in range(m):
  b, c = map(int, input().split())
  b -= 1
  c -= 1
  a[b] += 1
  a[c] += 1
  if h[b] == h[c]:
    if a[b] == 1 and a[c] == 1:
      ans -= 2
    elif a[b] == 1 and a[c] != 1:
      ans -= 1
    elif a[b] != 1 and a[c] == 1:
      ans -= 1
  if h[b] > h[c]:
    a[b] -= 1
    if a[c] == 1:
      ans -= 1
  if h[b] < h[c]:
    a[c] -= 1
    if a[b] == 1:
      ans -= 1
print(ans)

Fixed submission:
x = int(input())
a = []
for i in range(-200, 200):
  for j in range(-200, 200):
    if i**5 - j**5 == x:
      a.append([i, j])
      break
      
print(*a[0])
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
ans = 0
for i in range(n):
  for j in range(i+a[i], n):
    if abs(i- j) == a[i] + a[j]:
      ans += 1
    
print(ans)

Fixed submission:
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
l = [i + a[i] for i in range(n)]
r = [i - a[i] for i in range(n)]
countl = Counter(l)
countr = Counter(r)
ans = sum([countl[i]*countr[i] for i in countl.keys()])
print(ans)

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

Fixed submission:
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
l = [i + a[i] for i in range(n)]
r = [i - a[i] for i in range(n)]
countl = Counter(l)
countr = Counter(r)
ans = sum([countl[i]*countr[i] for i in countl.keys()])
print(ans)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
if n%2 == 1:
  for i in range(m):
    print(m-i, m+1+i)
else:
  for i in range(m):
    if 4*(i+1) > n:
      print(m-1, m+2+i)
    else:
      pritn(m-1, m+1+i)

Fixed submission:
n, m = map(int, input().split())
if n%2 == 1:
  for i in range(m):
    print(m-i, m+1+i)
else:
  for i in range(m):
    if 4*(i+1) > n:
      print(m-i, m+2+i)
    else:
      print(m-i, m+1+i)
Buggy python submission (verdict: Time Limit Exceeded):
s = input()[::-1]
counts = [0]*2019
counts[0] = 1
sum = 0
d = 1
for c in s:
  sum += int(c)*d
  remain = sum%2019
  d *= 10
  counts[remain] += 1

ans = 0
for count in counts:
  ans += count*(count - 1) / 2
print(int(ans))

Fixed submission:
s = input()[::-1]
counts = [0]*2019
counts[0] = 1
sum = 0
d = 1
for c in s:
  sum += int(c)*d
  remain = sum%2019
  d *= 10
  d %= 2019
  counts[remain] += 1

ans = 0
for count in counts:
  ans += count*(count - 1) / 2
print(int(ans))

Buggy python submission (verdict: Time Limit Exceeded):
s = str(input())
length = len(s)
count = 0
for i in range(length - 2):
  if int(s[i]) ==0:
    continue
  for j in range(i+3, length + 1):
    if int(s[i:j])%2019 == 0:
      count += 1
print(count)

Fixed submission:
s = input()[::-1]
counts = [0]*2019
counts[0] = 1
sum = 0
d = 1
for c in s:
  sum += int(c)*d
  remain = sum%2019
  d *= 10
  d %= 2019
  counts[remain] += 1

ans = 0
for count in counts:
  ans += count*(count - 1) / 2
print(int(ans))

Buggy python submission (verdict: Time Limit Exceeded):
s = str(input())
length = len(s)
count = 0
for i in range(length - 2):
  for j in range(i+3, length + 1):
    if int(s[i:j])%2019 == 0:
      count += 1
print(count)

Fixed submission:
s = input()[::-1]
counts = [0]*2019
counts[0] = 1
sum = 0
d = 1
for c in s:
  sum += int(c)*d
  remain = sum%2019
  d *= 10
  d %= 2019
  counts[remain] += 1

ans = 0
for count in counts:
  ans += count*(count - 1) / 2
print(int(ans))

Buggy python submission (verdict: Time Limit Exceeded):
s = str(input())
length = len(s)
base = []
for i in range(length + 1):
  for j in range(i+3, length + 1):
    if int(s[i:j])%2019 == 0:
      base.append(s[i:j])
print(len(base))
      

Fixed submission:
s = input()[::-1]
counts = [0]*2019
counts[0] = 1
sum = 0
d = 1
for c in s:
  sum += int(c)*d
  remain = sum%2019
  d *= 10
  d %= 2019
  counts[remain] += 1

ans = 0
for count in counts:
  ans += count*(count - 1) / 2
print(int(ans))
Buggy python submission (verdict: Time Limit Exceeded):
count = int(input())
su_list = list(map(int, input().split()))
for i in range(1, count + 1):
    print(su_list.count(i))

Fixed submission:
import collections
count = int(input())
su_list = list(map(int, input().split()))
c = collections.Counter(su_list)
for i in range(1, count + 1):
    print(c[i])

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

Fixed submission:
import collections
count = int(input())
su_list = list(map(int, input().split()))
c = collections.Counter(su_list)
for i in range(1, count + 1):
    print(c[i])
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = []
for i in range(a + 1):
  if i % 3 == 0:
    pass
  elif i 5 5 == 0:
    pass
  else:
    b.append(i)
c = sum(b)
print(c)

Fixed submission:
a = int(input())
b = []
for i in range(a + 1):
  if i % 3 == 0:
    pass
  elif i % 5 == 0:
    pass
  else:
    b.append(i)
c = sum(b)
print(c)
Buggy python submission (verdict: Runtime Error):
a = int(input())
from math import gcd
b = 0
for i in range(1, n + 1):
  for j in range(1, n + 1):
    for k in range(1, n + 1):
      b += gcd(gcd(i, j), k)
      
print(b)

Fixed submission:
a = int(input())
from math import gcd
b = 0
for i in range(1, a + 1):
  for j in range(1, a + 1):
    for k in range(1, a + 1):
      b += gcd(gcd(i, j), k)
      
print(b)
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=list(input())
ans=s.count('R')*s.count('G')*s.count('B')
for i in range(n):
  if s[i]=='R':
    s[i]=1
    elif s[i]=='G':
      s[i]=2
    elif s[i]=='B':
      s[i]=4
for i in range(n):
   for j in range(i+1,n):
      k=2*j-i
      if k>=n:
        continue
      if s[i]+s[j]+s[k]==7:
        ans-=1
print(ans)


Fixed submission:
n=int(input())
s=list(input())
ans=s.count('R')*s.count('G')*s.count('B')
for i in range(n):
  if s[i]=='R':
    s[i]=1
  elif s[i]=='G':
    s[i]=2
  elif s[i]=='B':
    s[i]=4
for i in range(n):
   for j in range(i+1,n):
      k=2*j-i
      if k>=n:
        continue
      if s[i]+s[j]+s[k]==7:
        ans-=1
print(ans)

Buggy python submission (verdict: Runtime Error):
n=int(input())
s=list(input())
ans=s.count('R')*s.count('G')*s.count('B')
for i in range(n):
  if s[i]=='R':
    s[i]=1
    elif s[i]=='G':
      s[i]
    elif s[i]=='B':
      s[i]=4
for i in range(n):
   for j in range(i+1,n):
      k=2*j-i
      if k>=n:
        continue
      if s[i]+s[j]+s[k]==7:
        ans-=1
print(ans)

Fixed submission:
n=int(input())
s=list(input())
ans=s.count('R')*s.count('G')*s.count('B')
for i in range(n):
  if s[i]=='R':
    s[i]=1
  elif s[i]=='G':
    s[i]=2
  elif s[i]=='B':
    s[i]=4
for i in range(n):
   for j in range(i+1,n):
      k=2*j-i
      if k>=n:
        continue
      if s[i]+s[j]+s[k]==7:
        ans-=1
print(ans)

Buggy python submission (verdict: Runtime Error):
n=int(input())
s=list(input())
ans=s.count('R')*s.count('G')*s.count('B')
for i in range(n):
   if s[i]=='R':
       s[i]=1
   elif s[i]=='G':
       s[i]
   elif s[i]=='B':
       s[i]=4
for i in range(n):
   for j in range(i+1,n):
     k=2*j-i
     if k>=n:
       continue
     if s[i]+s[j]+s[k]==7:
         ans-=1
print(ans)

Fixed submission:
n=int(input())
s=list(input())
ans=s.count('R')*s.count('G')*s.count('B')
for i in range(n):
  if s[i]=='R':
    s[i]=1
  elif s[i]=='G':
    s[i]=2
  elif s[i]=='B':
    s[i]=4
for i in range(n):
   for j in range(i+1,n):
      k=2*j-i
      if k>=n:
        continue
      if s[i]+s[j]+s[k]==7:
        ans-=1
print(ans)
Buggy python submission (verdict: Runtime Error):
category_number, popular_product_number = input().split()
product_list = input().split()
votes_number = sorted(product_list)[-popular_product_number]
border = sum(product_list)/4/popular_product_number
if votes_number < border:
  print('No')
else:
  print('Yes')

Fixed submission:
category_number, popular_product_number = input().split()
product = input().split()
product_list = [int(i) for i in product]
votes_number = sorted(product_list)[-int(popular_product_number)]
border = sum(product_list)/4/int(popular_product_number)
if votes_number < border:
  print('No')
else:
  print('Yes')
Buggy python submission (verdict: Runtime Error):
k, n = map(int, input().split())
house_list = list(map(int, input().split()))
for i in range(n):
  house_list.append(house_list[i] - k)
tmp_list = sorted(house_list)
ans_list = []
for j in range(n + 1):
  ans_list.append(tmp_list[j + n - 1] - tmp_list[j])
print(min(ans_list)

Fixed submission:
k, n = map(int, input().split())
house_list = list(map(int, input().split()))
for i in range(n):
  house_list.append(house_list[i] - k)
tmp_list = sorted(house_list)
ans_list = []
for j in range(n + 1):
  ans_list.append(tmp_list[j + n - 1] - tmp_list[j])
print(min(ans_list))

Buggy python submission (verdict: Runtime Error):
k, n = map(int, input().split())
house_list = list(map(int, input().split()))
for i in range(n):
  house_list.append(house_list[i] - k)
tmp_list = sorted(house_lise)
ans_list = []
for j in range(n + 1):
  ans_list.append(tmp_list[j + n - 1] - tmp_list[j])
print(min(ans_list)

Fixed submission:
k, n = map(int, input().split())
house_list = list(map(int, input().split()))
for i in range(n):
  house_list.append(house_list[i] - k)
tmp_list = sorted(house_list)
ans_list = []
for j in range(n + 1):
  ans_list.append(tmp_list[j + n - 1] - tmp_list[j])
print(min(ans_list))
Buggy python submission (verdict: Runtime Error):
s = list(input())
a = (len(s) - 1)/2
b = s[:a]
c = b[::-1]
if b == c:
  print('Yes')
else:
  print('No')

Fixed submission:
s = list(input())
s_reverse = s[::-1]
a = int((len(s) - 1)/2)
b = s[:a]
c = b[::-1]
if b == c and s == s_reverse:
  print('Yes')
else:
  print('No')