Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
def gcd(a, b):
  while b:
    a, b = b, a % b
  return a

a, b, c, d = map(int, input().split())
num = 0
cd = c*d/(gcd(c,d))
s = b - a + 1
s_c = int(s/c)
s_d = int(s/d)
s_cd = int(s/cd)
if(a%c >= b%c):
  num = num + 1
if(a%d >= b%d):
  num = num + 1
if(a%cd >= b%cd):
  num = num - 1
print(s -(s_c + s_d - s_cd) - num)

Fixed submission:
abcd = int(input())
d = int(abcd % 10)
c = int(((abcd - d) % 100)/10)
b = int((abcd - c*10 - d)%1000/100)
a = int(abcd / 1000)

if(a == b):
  print("Bad")
elif(b == c):
  print("Bad")
elif(c == d):
  print("Bad")
else:
  print("Good")

Buggy python submission (verdict: Runtime Error):
abcd = int(input())
d = abcd % 10
c = int(((abcd - d) % 100)/10)
b = (abcd - c*10 - d)%1000
a = int(abcd / 1000)

s = "Good"
if(a == b){
  s = "Bad"
}
if(b = c){
  s = "Bad"
}
if(c == d){
  s = "Bad"
}

print(s)

Fixed submission:
abcd = int(input())
d = int(abcd % 10)
c = int(((abcd - d) % 100)/10)
b = int((abcd - c*10 - d)%1000/100)
a = int(abcd / 1000)

if(a == b):
  print("Bad")
elif(b == c):
  print("Bad")
elif(c == d):
  print("Bad")
else:
  print("Good")
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list( map(int,input().split()))
B=int(1)
for i in A:
  B*=i
if(B>10**18):
  B=-1
print(B)

Fixed submission:
N=int(input())
A=list( map(int,input().split()))
A.sort()
B=int(1)
for i in A:
  B*=i
  if(B>10**18):
    B=-1
    break
print(B)
Buggy python submission (verdict: Time Limit Exceeded):
n = input()
a = list(map(int, input().split()))
sum = 1
for i in a:
  sum *= i

if sum > 10**18:
  sum = -1
print(sum)

Fixed submission:
n = input()
a = input().split()
a = [int(s) for s in a]
a.sort(reverse=True)

if a[-1] == 0:
  print(0)
else :
  sum = 1
  for i in a:
    sum *= i
    if sum > 10**18:
      sum = -1
      break
  print(sum)
Buggy python submission (verdict: Runtime Error):
s = list(input())

for i in range(len(s)):
  if s[i] == '?':
    if s[i+1] == 'D':
      s[i] = 'P'
    elif s[i+1] == '?':
      s[i] = 'P'
      s[i+1] = 'D'
    else :
      s[i] = 'D'
      
print("".join(s))

Fixed submission:
s = list(input())

for i in range(len(s)):
  if s[i] == '?':
    if i-1 >= 0 and s[i-1] == 'P':
      s[i] = 'D'
    elif i+1 < len(s) and s[i+1] == 'D':
      s[i] = 'P'
    elif i+1 < len(s) and  s[i+1] == '?':
      s[i] = 'P'
      s[i+1] = 'D'
    else :
      s[i] = 'D'
      
print("".join(s))
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
l = [1] * (n + 1)
l[0] = 0 
h = list(map(int, input().strip().split())) 
b_a = b_b  = 0
for i in range(m):
  a, b = map(int, input().split())
  if b_a == a and b_b == b :
    l[a] = l[b] = 0
  else if h[a-1] < h[b-1]:
    l[a] = 0
  else if h[a-1] > h[b-1] :
    l[b] = 0
  b_a = a
  b_b = b

print(sum(l))

Fixed submission:
n, m = map(int, input().split())
l = [1] * (n + 1)
l[0] = 0 
h = list(map(int, input().strip().split()))
h.insert(0, 0)
 
for i in range(m):
  a, b = map(int, input().split())
  if h[a] == h[b] :
    l[a] = l[b] = 0
  elif h[a] < h[b]:
    l[a] = 0
  else :
    l[b] = 0
  
 
print(sum(l))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

l=list(range(1,n+1))

for i in range(1,n+1) :

    if i%3==0:
        l.remove(i)

    elif i%5==0:
        l.remove(i)
    else:
        pass
print(sum(l))

Fixed submission:
n = int(input())

l=list(range(1,n+1))

count=0

for i in range(1,n+1) :
    if i%3!=0 and i%5!=0:
        count += i
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split(" ")))

x = 1
for i in range(N):
    x = x * A[i]

    if 0 in A:
        print(0)
        exit()

    if x > 10 ** 18:
        print(-1)
        exit()

print(x)


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

if 0 in A:
        print(0)
        exit()

x = 1
for i in range(N):
    x = x * A[i]
        
    if x > 10 ** 18:
        print(-1)
        exit()

print(x)

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

x = 1
for i in range(N):
    x = x * A[i]

if x > 10 ** 18:
    print("-1")

else:
    print(x)

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

if 0 in A:
        print(0)
        exit()

x = 1
for i in range(N):
    x = x * A[i]
        
    if x > 10 ** 18:
        print(-1)
        exit()

print(x)
Buggy python submission (verdict: Runtime Error):
import math


def prime_factorization(n):
    result = []

    N = n
    x = 2
    while x <= math.sqrt(N):
        if n % x == 0:
            result.append(x)
            n = n / x

        x += 1

    if n != 1:
       result.append(n)

    if result.count(result[-1]) > 1:
      result.pop(-1)
        
    return result


N = int(input())

result = prime_factorization(N)

print(len(result))



Fixed submission:
import math
from collections import Counter



def prime_factorization(num):
    """
    素因数分解
    ;param num 素因数分解したい数字
    ;return result {素因数: 回数, ・・・}
    """

    result = dict()

    N = num

    x = 2
    while x <= int(math.sqrt(num)) + 1:
        if (num % x) == 0:
            count = 0
            while (num % x) == 0:
                count += 1
                num = num / x

            result[x] = count

        x += 1

    if num != 1:
        result[num] = 1

    if result == []:
        result[N] = 1

    return result


N = int(input())

# 素因数分解
result = prime_factorization(N)

# 操作の回数を求める
ans = 0
for value in result.values():
    c = 1
    while (value - c) >= 0:
        ans += 1
        value -= c
        c += 1

print(ans)

Buggy python submission (verdict: Runtime Error):
import math


def prime_factorization(n):
    result = []

    N = n
    x = 2
    while x <= math.sqrt(N):
        if n % x == 0:
            result.append(x)
            n = n / x

        x += 1

    if n != 1:
       result.append(n)

    if result[-1] == result[-2]:
      result.pop(-1)
        
    return result


N = int(input())

result = prime_factorization(N)

print(len(result))



Fixed submission:
import math
from collections import Counter



def prime_factorization(num):
    """
    素因数分解
    ;param num 素因数分解したい数字
    ;return result {素因数: 回数, ・・・}
    """

    result = dict()

    N = num

    x = 2
    while x <= int(math.sqrt(num)) + 1:
        if (num % x) == 0:
            count = 0
            while (num % x) == 0:
                count += 1
                num = num / x

            result[x] = count

        x += 1

    if num != 1:
        result[num] = 1

    if result == []:
        result[N] = 1

    return result


N = int(input())

# 素因数分解
result = prime_factorization(N)

# 操作の回数を求める
ans = 0
for value in result.values():
    c = 1
    while (value - c) >= 0:
        ans += 1
        value -= c
        c += 1

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
def calculate_PD(exponent):

    D_count = exponent.count("D")
    PD_count = exponent.count("PD")

    return D_count + PD_count



T = input()

hatena_count = T.count("?")

patternes = []
for i in range(2**hatena_count):
    binary = format(i, 'b').zfill(hatena_count)

    pattern = binary.replace("0", "P").replace("1", "D")

    patternes.append(pattern)


exponent_list = []
for pattern in patternes:
    exponent = T[:]

    for i in range(hatena_count):
        exponent = exponent.replace("?", pattern[i], 1)

    exponent_list.append(exponent)


max_PD = 0
max_exponent = ""
for exponent in exponent_list:
    PD = calculate_PD(exponent)

    if PD > max_PD:
        max_PD = PD
        max_exponent = exponent

print(max_exponent)

Fixed submission:
T = input()
hatena_count = T.count("?")

pattern = ""
for i in range(hatena_count):
    pattern += "D"

max_exponent = T
for i in range(hatena_count):
    max_exponent = max_exponent.replace("?", pattern[i], 1)

print(max_exponent)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
ans = 1
for i in range(n):
  ans *= a[i]
if ans > pow(10,18):
    ans = -1
    print(ans)
else:
  print(ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = 1
if 0 in a:
  print(0)
else:
  for i in range(n):
    ans *= a[i]
    if ans > pow(10,18):
        ans = -1
        print(ans)
        break
  if ans != -1:
    print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
a = []
for l in sys.stdin:
    a.append(int(l))
p = input() .split()
s = set()
for i in range(1, len(p)):
    s.add(p[i])
print(len(set(s)))

Fixed submission:
s, w = map(int, (input().split()))
if s <= w:
    print("unsafe")
else:
    print("safe")
Buggy python submission (verdict: Runtime Error):
import sys
s = sys.stdin.readlines()
s = input() .split()
for i in range(1, len(s)):
    s.add(p[i])
print(len(set(s)))

Fixed submission:
n = int(input())
p = [input() for i in range(n)]
s = set()
for i in range(n):
    s.add(p[i])
print(len(s))

Buggy python submission (verdict: Runtime Error):
import sys
p = []
for l in sys.stdin:
    a.append(int(l))
s = set()
for i in range(1, len(p)):
    s.add(p[i])
print(len(set(s)))

Fixed submission:
n = int(input())
p = [input() for i in range(n)]
s = set()
for i in range(n):
    s.add(p[i])
print(len(s))

Buggy python submission (verdict: Runtime Error):
import sys
p = []
for l in sys.stdin:
    a.append(l)
s = set()
for i in range(1, len(p)):
    s.add(p[i])
print(len(set(s)))

Fixed submission:
n = int(input())
p = [input() for i in range(n)]
s = set()
for i in range(n):
    s.add(p[i])
print(len(s))

Buggy python submission (verdict: Runtime Error):
import sys
a = []
for l in sys.stdin:
    a.append(l)
p = input() .split()
s = set()
for i in range(1, len(p)):
    s.add(p[i])
print(len(set(s)))

Fixed submission:
n = int(input())
p = [input() for i in range(n)]
s = set()
for i in range(n):
    s.add(p[i])
print(len(s))

Buggy python submission (verdict: Runtime Error):
p = list((input().split()))
s = set()
for i in range(1, len(p)+1):
    s.add(p[i])
print(len(s))

Fixed submission:
n = int(input())
p = [input() for i in range(n)]
s = set()
for i in range(n):
    s.add(p[i])
print(len(s))

Buggy python submission (verdict: Runtime Error):
p = list((input().split()))
s = list()
for i in range(1, int(p[0])+1):
    s.append(p[i])
print(len(list(set(s))))

Fixed submission:
n = int(input())
p = [input() for i in range(n)]
s = set()
for i in range(n):
    s.add(p[i])
print(len(s))

Buggy python submission (verdict: Runtime Error):
p = list((input().split()))
s = []
for i in range(1, int(p[0])):
    s.append(p[i])
print(len(list(set(s))))

Fixed submission:
n = int(input())
p = [input() for i in range(n)]
s = set()
for i in range(n):
    s.add(p[i])
print(len(s))

Buggy python submission (verdict: Runtime Error):
p = list((input().split()))
s = set()
for i in range(1, int(p[0])):
    s.add(p[i])
print(len(list(s)))


Fixed submission:
n = int(input())
p = [input() for i in range(n)]
s = set()
for i in range(n):
    s.add(p[i])
print(len(s))

Buggy python submission (verdict: Runtime Error):
p = list((input().split()))
s = set()
for i in range(1, int(p[0])):
    s.add(p[i])
print(len(s))

Fixed submission:
n = int(input())
p = [input() for i in range(n)]
s = set()
for i in range(n):
    s.add(p[i])
print(len(s))
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    a = input().split()

    maks = 10**18
    mnozenje = 1
    for i in a:
        mnozenje *= int(i)

    if mnozenje > maks:
        print(-1)
    else:
        print(mnozenje)


if __name__ == '__main__':
    main()


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

    if 0 in a:
        print(0)
        return

    maks = 10**18
    mnozenje = 1
    for i in a:
        mnozenje *= i

        if mnozenje > maks:
            print(-1)
            return

    print(mnozenje)


if __name__ == '__main__':
    main()

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

    maks = 10**18
    mnozenje = 1
    for i in a:
        mnozenje *= i
        
    if mnozenje > maks:
        print(-1)
    else:
        print(mnozenje)


if __name__ == '__main__':
    main()


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

    if 0 in a:
        print(0)
        return

    maks = 10**18
    mnozenje = 1
    for i in a:
        mnozenje *= i

        if mnozenje > maks:
            print(-1)
            return

    print(mnozenje)


if __name__ == '__main__':
    main()

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

    mnozenje = 1
    for i in a:
        mnozenje *= i

    if mnozenje > 10**18:
        print(-1)
    else:
        print(mnozenje)


if __name__ == '__main__':
    main()


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

    if 0 in a:
        print(0)
        return

    maks = 10**18
    mnozenje = 1
    for i in a:
        mnozenje *= i

        if mnozenje > maks:
            print(-1)
            return

    print(mnozenje)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
sum=1
i=list(map(int,input().split()))
for cnt in range(N):
  sum=sum*i[cnt]
if sum>1000000000000000000:
	sum=-1
print(sum)

Fixed submission:
N=int(input())
sum=1
i=list(map(int,input().split()))
if 0 in i:
  sum=0
else:
	for cnt in range(N):
		sum=sum*i[cnt]
		if sum>1000000000000000000:
			sum=-1
			break
print(sum)

Buggy python submission (verdict: Runtime Error):
#include <iostream>
using namespace std;

int main ()
{
	long n, a;
	long ret = 1;
	bool flag = true;

	cin >> n;

	for (int i=0; i<n; i++) {
		cin >> a;
		if (a == 0) {
			cout << 0 << endl;
			return 0;
		}
		ret *= a;
		if (ret <= 0 || 1000000000000000000 < ret) {
			flag = false;
		}
	}

	if (flag == false) {
		cout << -1 << endl;
	} else {
		cout << ret << endl;
	}

	return 0;
}


Fixed submission:
n = int(input())
MX = 10 **18
a = list(map(int, input().split()))
for x in a:
    if x == 0:
        print(0)
        exit(0)
ans = 1
for x in a:
    ans *= x
    if ans > MX:
        print(-1)
        exit(0)
print(ans)
Buggy python submission (verdict: Runtime Error):
s = str(input())
a = 2019
i = 0
ans = 0
while True:
    i += 1
    b = a * i
    if b > int(s):
        break
    ans += s.count(str(b))
print (str(ans))

Fixed submission:
s,w = map(int,input().split())
if w >= s:
    print ('unsafe')
else:
    print ('safe')
Buggy python submission (verdict: Runtime Error):

import sys
import itertools
 
 
N, K = map(int, input().split())

nums = [ ]
for _ in range(N):
    _ =  int(input())
    nums.extend([int(x.strip()) for x in input().split(' ') ])

print(N - len(set(nums)))

Fixed submission:

import sys
import itertools
 
 
N, K = map(int, input().split())

nums = [ ]
for _ in range(K):
    _ =  int(input())
    nums.extend([int(x.strip()) for x in input().split(' ') ])

print(N - len(set(nums)))
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!

N = int(input())
RGB= list(input())

count = 0
sub = 0

def index_Multi(List):
    r_list = []
    g_list = []
    b_list = []
    for val in range(0,len(List)):
        if "R" == List[val]:
            r_list.append(val)
        elif "G" == List[val]:
            g_list.append(val)
        elif "B" == List[val]:
            b_list.append(val)
    return r_list, g_list, b_list
    
r_list, g_list ,b_list = index_Multi(RGB)

for index, a in enumerate(RGB):
    if a == "R":
        del g_list[0:len([i for i in g_list if i < index])]
        del b_list[0:len([i for i in b_list if i < index])]
        for g in g_list:
            for b in b_list:
                if g-index == b-g or b-index == g-b:
                    sub +=1
        count = count + len(g_list)*len(b_list)
                    
    elif a == "G":
        del b_list[0:len([i for i in b_list if i < index])]
        del r_list[0:len([i for i in r_list if i < index])]
        for b in b_list:
            for r in r_list:
                if b-index == r-b or r-index == b-r:
                    sub +=1
        count = count + len(b_list)*len(r_list)
                
    elif a == "B":
        del r_list[0:len([i for i in r_list if i < index])]
        del g_list[0:len([i for i in g_list if i < index])]
        for r in r_list:
            for g in g_list:
                if r-index == g-r or g-index == r-g:
                    sub +=1
        count = count + len(g_list)*len(r_list) 
        
print(count-sub)


Fixed submission:
import sys
 
X = input()
test = list(X)
for num in test:
  tmp = int(num)
  if tmp == 7:
    print("Yes")
    sys.exit()
print("No")

Buggy python submission (verdict: Runtime Error):
import sys

X =int, input()
test = list(X)
print(test)
for num in test:
  tmp = int(num)
  if tmp == 7:
    print("Yes")
    sys.exit()
print("No")

Fixed submission:
import sys
 
X = input()
test = list(X)
for num in test:
  tmp = int(num)
  if tmp == 7:
    print("Yes")
    sys.exit()
print("No")
Buggy python submission (verdict: Runtime Error):
import sys

X = input()
count = 0
for num in range(X):
  if not num % 3 == 0 or num % 5 == 0:
    count = count + num
print(count)

Fixed submission:
import sys
 
X = int(input())
count = 0
for num in range(1, X+1):
  if num % 3 == 0 or num % 5 == 0:
    continue
  else:
    count = count + num
print(count)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
N, M = map(int, input().split())
import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
if N != 0:
  if N != 1:
    N_sum = combinations_count(N, 2)
  else:
    N_sum = 0
else:
  N_sum = 0
if M != 0:
  if M != 1:
    M_sum = combinations_count(M, 2)
  else:
    M_sum = 0
else:
  M_sum = 0
print(N_sum + M_sum)

Fixed submission:
# -*- coding: utf-8 -*-
X, Y, Z = map(int, input().split())
print(Z, X, Y)
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import sys
N, K = map(int, input().split())
if K == 1:
  print(0)
  sys.exit()
  
a = abs(N-K)
while abs(a - K) < a:
  a = abs(a-K)
  if a == N:
    print(a)
    sys.exit()
  
print(a)

Fixed submission:
# -*- coding: utf-8 -*-
import sys

N, K = map(int, input().split())
if K == 1:
  print(0)
  sys.exit()
  
if N / K > 1:
  N = N - int(N / K) * K
a = abs(N-K)
while abs(a - K) < a:
  a = abs(a-K)

print(int(a))

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import sys
N, K = map(int, input().split())
if K == 1:
  print(0)
  sys.exit()
  
min = N
a = abs(N-K)
while abs(a - K) < a:
  a = abs(a-K)
  
print(a)

Fixed submission:
# -*- coding: utf-8 -*-
import sys

N, K = map(int, input().split())
if K == 1:
  print(0)
  sys.exit()
  
if N / K > 1:
  N = N - int(N / K) * K
a = abs(N-K)
while abs(a - K) < a:
  a = abs(a-K)

print(int(a))
Buggy python submission (verdict: Runtime Error):
l=int(input())
print((l/3)**3)

Fixed submission:
# -*- coding: utf-8 -*-
N, M = map(int, input().split())
import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
if N != 0:
  if N != 1:
    N_sum = combinations_count(N, 2)
  else:
    N_sum = 0
else:
  N_sum = 0
if M != 0:
  if M != 1:
    M_sum = combinations_count(M, 2)
  else:
    M_sum = 0
else:
  M_sum = 0
print(N_sum + M_sum)

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# 整数の入力
N, M= map(int, input().split())
import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
if N != 0:
  N_sum = combinations_count(N, 2)
else:
  N_sum = 0
if M != 0:
  M_sum = combinations_count(M, 2)
else:
  M_sum = 0
print(N_sum + M_sum)

Fixed submission:
# -*- coding: utf-8 -*-
N, M = map(int, input().split())
import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
if N != 0:
  if N != 1:
    N_sum = combinations_count(N, 2)
  else:
    N_sum = 0
else:
  N_sum = 0
if M != 0:
  if M != 1:
    M_sum = combinations_count(M, 2)
  else:
    M_sum = 0
else:
  M_sum = 0
print(N_sum + M_sum)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# 整数の入力
# 1以上N以下の整数のうち、10進法での各桁の和が
# A以上B以下であるものの総和を求めてください。
n = input() # 2 ~ 99
an = []
an = input().split() 1 ~ 1000

ocunt = 0
for i in an:
  if i % 2 == 0:
    if i % 3 == 0 or i % 5 == 0:
      count += 1
      break:
if count == 1:
  print('APPROVED')
else:
  print('DENIED')

Fixed submission:
# -*- coding: utf-8 -*-
n = input() # 2 ~ 99
an = [int(x.strip()) for x in input().split(' ')]

count = 0
check = 0
for i in an:
  if i % 2 == 0:
    check += 1
    if i % 3 == 0 or i % 5 == 0:
      count += 1
if count == check or check == 0:
  print('APPROVED')
else:
  print('DENIED')
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
bc = n*[0]
gc = n*[0]
rc = n*[0]
for i in range(1, n+1):
    mi = n - i
    if s[n - i] == 'B':
        if i == 1:
            bc[mi] = 1
        else:
            bc[mi] = bc[mi+1] + 1
            rc[mi] = rc[mi+1]
            gc[mi] = gc[mi+1]
    elif s[mi] == 'R':
        if i == 1:
            rc[mi] = 1
        else:
            rc[mi] = rc[mi+1] + 1
            bc[mi] = bc[mi+1]
            gc[mi] = gc[mi+1]
    elif s[mi] == 'G':
        if i ==1:
            gc[mi] = 1
        else:
            gc[mi] = gc[mi+1] + 1
            rc[mi] = rc[mi+1]
            bc[mi] = bc[mi+1]
si = 0
for i in range(0, n - 1):
    
    for j in range(i+1, n-1):
        if s[j] != s[i]:
            d = j-i 
            if j+d < n:
                nc = s[j+d]
                if nc in [s[i], s[j]]:
                    l = list(set(['R', 'G', 'B']) - set([s[i], s[j]]))
                    if l[0] == 'R':
                        si+= rc[j+1]
                    elif l[0] == 'G':
                        si += gc[j+1] 
                    else:
                        si += bc[j+1]
                else:
                    l = list(set(['R', 'G', 'B']) - set([s[i], s[j]]))
                    if l[0] == 'R':
                        si+= rc[j+1]-1
                    elif l[0] == 'G':
                        si += gc[j+1] -1
                    else:
                        si += bc[j+1] - 1
            else:
                l = list(set(['R', 'G', 'B']) - set([s[i], s[j]]))
                if l[0] == 'R':
                    si+= rc[j+1]
                elif l[0] == 'G':
                    si += gc[j+1] 
                else:
                    si += bc[j+1]
print(si)

Fixed submission:
n = input()
b = 0
for i in n:
    if i == '7':
        b= 1
        break

if b == 1:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n = input()
b = 0
s = 0
for i in n:
    if i%3 == 0 or i%5 == 0:
        continue
    else:
        s += i
        
print(s)

Fixed submission:
n = int(input())
b = 0
s = 0
for i in range(1,n+1):
    if i%3 == 0 or i%5 == 0:
        continue
    else:
        s += i
        
print(s)