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

day_d = {\
    "SUN":7,
    "MAN":6,
    "TUE":5,
    "WED":4,
    "THU":3,
    "FRI":2,
    "SAT":1
    }

print(day_d[N])


Fixed submission:
N = input()

day_d = {\
    "SUN":7,
    "MON":6,
    "TUE":5,
    "WED":4,
    "THU":3,
    "FRI":2,
    "SAT":1
    }

print(day_d[N])
Buggy python submission (verdict: Time Limit Exceeded):
S = input()
ans_l = [0 for _ in range(len(S))]
for i in range(len(S)):
    if(S[i]=="R"):
        j = 0
        while(S[i+j]=="R"):
            j += 1
        if(j%2==1):
            ans_l[i+j-1]+=1
        else:
            ans_l[i+j]+=1

    if(S[i]=="L"):
        j = 0
        while(S[i-j]=="L"):
            j += 1
        if(j%2==1):
            ans_l[i-j+1]+=1
        else:
            ans_l[i-j]+=1

print(" ".join(map(str,ans_l)))



Fixed submission:
S = input()
ans_l = [0 for _ in range(len(S))]

"""
for i in range(len(S)):
    if(S[i]=="R"):
        j = 0
        while(S[i+j]=="R"):
            j += 1
        if(j%2==1):
            ans_l[i+j-1]+=1
        else:
            ans_l[i+j]+=1

    if(S[i]=="L"):
        j = 0
        while(S[i-j]=="L"):
            j += 1
        if(j%2==1):
            ans_l[i-j+1]+=1
        else:
            ans_l[i-j]+=1
"""
i =0
while(i<len(S)):
    j=0
    while(S[i+j]=="R"):
        j += 1
    k=0
    while(S[i+j+k]=="L"):
        k += 1
        if(i+j+k>=len(S)):
            break
    ans_l[i+j-1] += j//2+ k//2 + j%2
    ans_l[i+j] += j//2 + k//2 + k%2
    i += j+k


print(" ".join(map(str,ans_l)))
Buggy python submission (verdict: Runtime Error):
N = int(input())
al = list(map(int,input().split()))
ansal = sorted(al)

for i in range(N):
    for j in range(i,N):
        cond_al = al.copy()
        cond_al[i],cond_al[j] = cond_al[j],cond_al[i]
        if(cond_al==ansal):
            print("YES")
            exit(1)

print("NO")


Fixed submission:
N = int(input())
al = list(map(int,input().split()))
ansal = sorted(al)

for i in range(N):
    for j in range(i,N):
        cond_al = al.copy()
        cond_al[i],cond_al[j] = cond_al[j],cond_al[i]
        if(cond_al==ansal):
            print("YES")
            exit(0)

print("NO")
Buggy python submission (verdict: Runtime Error):
import math
import itertools

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def main():
    N,K = map(int,input().split(" "))
    for i in range(1,K+1):
        print(combinations_count(K-1,i-1)*combinations_count(N-K+1,i)%(10**9+7))

if __name__=='__main__':
    main()


Fixed submission:
import math
import itertools

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def main():
    N,K = map(int,input().split(" "))
    for i in range(1,K+1):
        if(i<=N-K+1):
            print(combinations_count(K-1,i-1)*combinations_count(N-K+1,i)%(10**9+7))
        else:
            print(0)

if __name__=='__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import math

A,B,C,D = map(int,input().split(" "))
min_C = int(B/C)-int((A-1)/C)
min_D = int(B/D)-int((A-1)/D)
lcm = int(C*D/math.gcd(C,D))
min_lcm = int(B/lcm)-int((A-1)/lcm)
print(B-A-min_C-min_D+min_lcm+1)



Fixed submission:
def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a

def lcm(a,b):
    return a*b//gcd(a,b)

A,B,C,D = map(int,input().split(" "))
min_C = B//C-(A-1)//C
min_D = B//D-(A-1)//D
lcm = lcm(C,D)
min_lcm = B//lcm-(A-1)//lcm
print(B-A-min_C-min_D+min_lcm+1)

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

A,B,C,D = map(int,input().split(" "))
min_C = int(B/C)-int((A-1)/C)
min_D = int(B/D)-int((A-1)/D)
lcm = C*D//math.gcd(C,D)
min_lcm = int(B/lcm)-int((A-1)/lcm)
print(B-A-min_C-min_D+min_lcm+1)



Fixed submission:
def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a

def lcm(a,b):
    return a*b//gcd(a,b)

A,B,C,D = map(int,input().split(" "))
min_C = B//C-(A-1)//C
min_D = B//D-(A-1)//D
lcm = lcm(C,D)
min_lcm = B//lcm-(A-1)//lcm
print(B-A-min_C-min_D+min_lcm+1)

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

A,B,C,D = map(int,input().split(" "))
min_C = B//C-(A-1)//C
min_D = B//D-(A-1)//D
lcm = C*D//math.gcd(C,D)
min_lcm = B//lcm-(A-1)//lcm
print(B-A-min_C-min_D+min_lcm+1)



Fixed submission:
def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a

def lcm(a,b):
    return a*b//gcd(a,b)

A,B,C,D = map(int,input().split(" "))
min_C = B//C-(A-1)//C
min_D = B//D-(A-1)//D
lcm = lcm(C,D)
min_lcm = B//lcm-(A-1)//lcm
print(B-A-min_C-min_D+min_lcm+1)
Buggy python submission (verdict: Runtime Error):
import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def stairs(n):
    if(n<=0):
        return 1
    comb = 0
    for i in range(int(n/2)+1):
        comb += combinations_count(n-i,i)
    return comb

def main():
    N,M = map(int,input().split(" "))
    broken_l = []
    for _ in range(M):
        broken_l.append(int(input()))

    broken_l.append(-1)
    broken_l.append(N+1)
    broken_l.sort()
    ans = 1
    for i in range(len(broken_l)-1):
        step = broken_l[i+1] - broken_l[i]
        if(step == 1 and broken_l[i+1]!=1):
            print(0)
            exit(0)
        else:
            ans *= stairs(step-2)
            ans = ans%(10**9+7)

    print(ans)
if __name__ == '__main__':
    main()

Fixed submission:
def main():
    P,Q,R = map(int,input().split(" "))
    print(min([P+Q,Q+R,P+R]))

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import math
A,B,N=map(int,input().split())
result=0
if B<=N:
	x=B-1
	while x<=N:
	  tmp=math.floor(A*x/B)-A*math.floor(x/B)
	  if tmp>result:
	    result=tmp
	  x+=B
if B>N:
	result=math.floor(A*N/B)-A*math.floor(N/B)
if B==1:
  print(0)
else:
  print(result)


Fixed submission:
import math
A,B,N=map(int,input().split())
result=0
if B<=N:
	x=(N//B)*B-1
	result=math.floor(A*x/B)-A*math.floor(x/B)
if B>N:
	result=math.floor(A*N/B)-A*math.floor(N/B)
if B==1:
  print(0)
else:
  print(result)

Buggy python submission (verdict: Time Limit Exceeded):
import math
A,B,N=map(int,input().split())
result=0
if B<=N:
	x=B-1
	while x<=N:
	  tmp=math.floor(A*x/B)-A*math.floor(x/B)
	  if tmp>result:
	    result=tmp
	  x+=B
if B>N:
  x=0
  while x<=N:
    tmp=math.floor(A*x/B)-A*math.floor(x/B)
    if tmp>result:
      result=tmp
    x+=1
if B==1:
  print(0)
else:
  print(result)


Fixed submission:
import math
A,B,N=map(int,input().split())
result=0
if B<=N:
	x=(N//B)*B-1
	result=math.floor(A*x/B)-A*math.floor(x/B)
if B>N:
	result=math.floor(A*N/B)-A*math.floor(N/B)
if B==1:
  print(0)
else:
  print(result)
Buggy python submission (verdict: Runtime Error):
X, Y, Z=int(input().split())
 
print(Z, X, Y)

Fixed submission:
X,Y,Z=map(int, input().split())

print(Z,X,Y)

Buggy python submission (verdict: Runtime Error):
X,Y,Z=int(input().split())

print(Z,X,Y)

Fixed submission:
X,Y,Z=map(int, input().split())

print(Z,X,Y)
Buggy python submission (verdict: Runtime Error):
import math
A,B=map(int, input().split())
 
print(math.ceil(B/A)

Fixed submission:
import math
A,B=map(int, input().split())

print(1+math.ceil((B-A)/(A-1)))

Buggy python submission (verdict: Runtime Error):
import math
A,B=map(int, input().split())
if B==1 :
    print(1)
else :
    print(math.ceil((B-1)/(A-1))

Fixed submission:
import math
A,B=map(int, input().split())

print(1+math.ceil((B-A)/(A-1)))

Buggy python submission (verdict: Runtime Error):
import math
A,B=map(int, input().split())
 
print(math.ceil((B-1)/(A-1))

Fixed submission:
import math
A,B=map(int, input().split())

print(1+math.ceil((B-A)/(A-1)))
Buggy python submission (verdict: Runtime Error):
N=int(input())
print(X//3)

Fixed submission:
N=int(input())
print(N//3)
Buggy python submission (verdict: Runtime Error):
import math
N=int(input())

print(math.factorical(N)%(10**+7))

Fixed submission:
import math
N=int(input())

print(math.factorial(N)%(10**9+7))

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

N=int(input())
print((math.factorical(N))%(10**9+7))

Fixed submission:
import math
N=int(input())

print(math.factorial(N)%(10**9+7))
Buggy python submission (verdict: Runtime Error):
a,b,c=input().split()
print(a,b,c)

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

Buggy python submission (verdict: Runtime Error):
a,b,c=map(input().split(","))
print(a,b,c)

Fixed submission:
a,b,c=input().split(",")
print(a,b,c)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
List = [input() for i in range(N)]

c = [x for x in set(List) if List.count(x) > 1]
d = [x for x in set(List) if List.count(x) < 2]

print(len(c)+len(d))


Fixed submission:
N = int(input())
List = [input() for i in range(N)]

print(len(set(List)))
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
M = 1
while M <= N :
    print(A.count(M))
    M = M+1


Fixed submission:
R = int(input())

print(R*6.283)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
M = 1
while M <= N :
    print(A.count(M))
    M = M+1


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

a = [0]*N

for i in range(N-1) :
  a[A[i]-1] = a[A[i]-1]+1
 
for i in a :
  print(i)
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input())

if a*b*c == 0 :
  print("No")
elif:a*b*c%7 == 0 :
  print("Yes")
else: print("No")

Fixed submission:
a,b,c = map(int,input())

if a*b*c == 0 :
  print("No")
elif a*b*c%7 == 0 :
  print("Yes")
else: print("No")
Buggy python submission (verdict: Runtime Error):
K = int(input())
A,B = map(int, input().split())
for i in range(A, B+1):
	if i % K == 0:
		print('OK')
		exit()
print('NG'

Fixed submission:
K = int(input())
score = input().split()
s1 = int(score[0])
s2 = int(score[1])
if ( s1 % K ) == 0:
		print('OK')
elif ( s2 % K ) == 0:
		print('OK')
elif ( s1 // K ) < ( s2 // K ):
		print('OK')
else:
		print('NG')

Buggy python submission (verdict: Runtime Error):
K = int(input())
score = input().split()
if int(score[0] < K):
	if int(int(score[0])/K) < int(int(score[1])/K):
		print('OK')
	else:
		if int(score[0]) % K == int(score[1]) % K:
			print('OK')
		else:
			print('NG')

Fixed submission:
K = int(input())
score = input().split()
s1 = int(score[0])
s2 = int(score[1])
if ( s1 % K ) == 0:
		print('OK')
elif ( s2 % K ) == 0:
		print('OK')
elif ( s1 // K ) < ( s2 // K ):
		print('OK')
else:
		print('NG')

Buggy python submission (verdict: Runtime Error):
K = int(input())
score = input().split()
if int(int(score[0])/K) < int(int(score[1])/K):
	print('OK')
else:
	if int(score[0]) % K == int(score[1]) % K:
		print('OK')
	else:
		print('NG'

Fixed submission:
K = int(input())
score = input().split()
s1 = int(score[0])
s2 = int(score[1])
if ( s1 % K ) == 0:
		print('OK')
elif ( s2 % K ) == 0:
		print('OK')
elif ( s1 // K ) < ( s2 // K ):
		print('OK')
else:
		print('NG')
Buggy python submission (verdict: Runtime Error):
N = input()
b = list(map(int, input().split()))
a = list(set(b))

for i in range(len(a)):
    if i == 0:
        if not a[-1] ^ a[i+1] == a[i]:
            print('No')
            break
    elif i == len(a)-1:
        if a[0] ^ a[-2] == a[i]:
            print('Yes')
            break
        else:
            print('No')
            break
    else:
        if not a[i-1] ^ a[i+1] == a[i]:
            print('No')
            break

Fixed submission:
a = [input() for i in range(2)]
 
N = int(a[0])
data = a[1].split(' ')
 
data = [int(i) for i in data]
 
result = []
a = 0
for i in range(N):
    a = a ^ data[i]
    
if a == 0:
    print('Yes')
    exit()
    
print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
count = 0
for i in range(N):
    start = i + A[i]
    for j in range(start,N):
        if A[j] == j-start:
            count = count + 1
print(count)


Fixed submission:
import collections

N = int(input())
A = list(map(int, input().split()))
diff = [0]*N
summ = [0]*N
count = 0
for i in range(N):
    diff[i] = i - A[i]
    summ[i] = A[i] + i

c_diff = collections.Counter(diff)
c_summ = collections.Counter(summ)
for k in c_diff.keys():
    count = count + c_diff[k]*c_summ[k]
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
N, K, Q = list(map(int, input().split()))
A = []
for i in range(Q):
  A.append(int(input()))

for i in range(N):
    if K > Q-A.count(i+1):
        print("Yes")
    else:
        print("No")


Fixed submission:
N, K, Q = list(map(int, input().split()))
A = [0]*N
for i in range(Q):
    num = int(input())
    A[num-1] += 1
# n番目の人の正解数がA[n-1]に入る
for i in range(N):
    if K > Q-A[i]:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):
L, R = list(map(int, input().split()))

if (R-L) > 2018:
    print(0)
else:
    mini = 2019
    for i in range(L,R):
        for j in range(i+1,R+1):
            mini = min(mini, i*j%2019)
print(mini)


Fixed submission:
L, R = list(map(int, input().split()))

if (R-L) > 2018:
    print(0)
else:
    mini = 2019
    for i in range(L,R):
        for j in range(i+1,R+1):
            mini = min(mini, (i*j)%2019)
    print(mini)

Buggy python submission (verdict: Runtime Error):
L, R = list(map(int, input().split()))

if (R-L) > 2018:
    print(0)
else:
    mini = 2019
    for i in range(R-L):
        mini = min(mini, (L+i)*(L+i+1)%2019)
print(mini)


Fixed submission:
L, R = list(map(int, input().split()))

if (R-L) > 2018:
    print(0)
else:
    mini = 2019
    for i in range(L,R):
        for j in range(i+1,R+1):
            mini = min(mini, (i*j)%2019)
    print(mini)
Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce
def gcd_list(numbers):
    return reduce(math.gcd, numbers)
N, X = list(map(int, input().split()))
A = list(map(int, input().split()))
for i in range(N):
    A[i] = abs(A[i] - X)
print(gcd_list(A))


Fixed submission:
N, X = list(map(int, input().split()))
A = list(map(int, input().split()))
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
for i in range(N):
    A[i] = abs(A[i] - X)
g = A[0]
for i in range(1, N):
    g = gcd(g, A[i])
print(g)

Buggy python submission (verdict: Runtime Error):
import math
N, X = list(map(int, input().split()))
A = list(map(int, input().split()))
for i in range(N):
    A[i] = abs(A[i] - X)
g = A[0]
for i in range(1, N):
    g = math.gcd(g, A[i])
print(g)


Fixed submission:
N, X = list(map(int, input().split()))
A = list(map(int, input().split()))
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
for i in range(N):
    A[i] = abs(A[i] - X)
g = A[0]
for i in range(1, N):
    g = gcd(g, A[i])
print(g)
Buggy python submission (verdict: Runtime Error):
S = input()
K = int(input())
i = 0
while 1:
    if S[i] != '1':
        print(S[i])
        break
    else:
        i += 1


Fixed submission:
S = input()
K = int(input())
for i in range(len(S)):
    if S[i] != '1':
        if K >= i+1:
            print(S[i])
        else:
            print(1)
        break
else:
    print(1)
Buggy python submission (verdict: Time Limit Exceeded):
import copy
N = int(input())
A = list(map(int, input().split()))
for i in range(N):
    X = copy.deepcopy(A)
    X.pop(i)
    X.sort()
    if N % 2 == 0:
        print(X[int(N/2)-1])
    else:
        print((X[int((N-1)/2)-1]+X[int((N-1)/2)])/2)


Fixed submission:
import copy
N = int(input())
A = list(map(int, input().split()))
X = copy.deepcopy(A)
X.sort()
for i in range(N):
    if A[i] >= X[int(N/2)]:
        print(X[int(N/2)-1])
    else:
        print(X[int(N/2)])
Buggy python submission (verdict: Time Limit Exceeded):
import copy
N = int(input())
A = list(map(int, input().split()))

for i in range(N):
    route = copy.deepcopy(A)
    route.pop(i)
    route.insert(0,0)
    route.append(0)
    #print(route)
    dist = 0
    for j in range(N):
        dist += abs(route[j]-route[j+1])
    print(dist)


Fixed submission:
import copy
N = int(input())
A = list(map(int, input().split()))
A.append(0)
A.insert(0,0)
dist = 0
for j in range(N+1):
    dist += abs(A[j]-A[j+1])
for j in range(N):
    res = dist + abs(A[j+2]-A[j]) - abs(A[j+1]-A[j]) - abs(A[j+2]-A[j+1])
    print(res)
Buggy python submission (verdict: Runtime Error):
import math
N = int(input())
F = [[] * 10 for i in range(N)]
for i in range(N):
    F[i] = list(map(int, input().split()))
P = [[] * 11 for i in range(N)]
for i in range(N):
    P[i] = list(map(int, input().split()))
L = [0] * 10
Sum_max = -float(math.inf)
for i in range(1, 1024):
    for j in range(10):
        L[j] = i % 2
        i = int(i / 2)
    Sum = 0
    for j in range(N):
        count = 0
        for k in range(10):
            if L[k] == 1 and F[j][k] == 1:
                count += 1
        Sum += P[j][count]
    Sum_max = max(Sum_max, Sum)
print(Sum_max)


Fixed submission:
import math
N = int(input())
F = [[] * 10 for i in range(N)]
for i in range(N):
    F[i] = list(map(int, input().split()))
P = [[] * 11 for i in range(N)]
for i in range(N):
    P[i] = list(map(int, input().split()))
L = [0] * 10
Sum_max = -float("inf")
for i in range(1, 1024):
    for j in range(10):
        L[j] = i % 2
        i = int(i / 2)
    Sum = 0
    for j in range(N):
        count = 0
        for k in range(10):
            if L[k] == 1 and F[j][k] == 1:
                count += 1
        Sum += P[j][count]
    Sum_max = max(Sum_max, Sum)
print(Sum_max)
Buggy python submission (verdict: Runtime Error):
def ope(i, ans, ans_str):
    if i == 3:
        if ans == 7:
            print(ans_str)
    else:
        ope(i+1, ans+int(S[i+1]), ans_str + "+" + S[i+1])
        ope(i+1, ans-int(S[i+1]), ans_str + "-" + S[i+1])
S = list(input())
ope(0,int(S[0]),S[0])+"=7"


Fixed submission:
S = input()
A = int(S[0])
B = int(S[1])
C = int(S[2])
D = int(S[3])
def ope(x,y,n,s):
    if n % 2 == 0:
        return x+y, str(s) + '+' + str(y)
    else:
        return x-y, str(s) + '-' + str(y)
for i in range(8):
    X1, S1 = ope(A,B,i,A)
    j = int(i/2)
    X2, S2 = ope(X1,C,j,S1)
    k = int(j/2)
    X3, S3 = ope(X2,D,k,S2)
    if X3 == 7:
        print(S3 + '=7')
        break
Buggy python submission (verdict: Runtime Error):
import bisect
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A = A.sort()
B = B.sort()
C = C.sort()
Sum = 0
for i in range(N):
    Start_B = bisect.bisect_left(B,A[i]+1)
    for j in range(Start_B, N):
        Start_C = bisect.bisect_left(C,B[j]+1)
        Sum += N - Start_C
print(Sum)


Fixed submission:
N, M = list(map(int, input().split()))
T1 = (N-M) * 100
T2 = (1900 * M)
print ((2 ** M) * (T1+ T2))
Buggy python submission (verdict: Time Limit Exceeded):
K, S = list(map(int, input().split()))
count = 0
for x in range(K+1):
    for y in range(x, K+1):
        for z in range(y, K+1):
            if x + y + z == S:
                if x == y and y == z:
                    count += 1
                elif x == y or y == z or z == x:
                    count += 3
                else:
                    count += 6
                break
print(count)


Fixed submission:
K, S = list(map(int, input().split()))
count = 0
for x in range(K+1):
    for y in range(K+1):
        z = S - x - y
        if z <= K and z >= 0:
            count += 1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
K, S = list(map(int, input().split()))
count = 0
for x in range(K+1):
    for y in range(K+1):
        for z in range(K+1):
            if x + y + z == S:
                count += 1
                break
print(count)


Fixed submission:
K, S = list(map(int, input().split()))
count = 0
for x in range(K+1):
    for y in range(K+1):
        z = S - x - y
        if z <= K and z >= 0:
            count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
N, M = input().split()
N = int(N)
M = int(M)
numbers = input().split()
numbers = [int(n) for n in numbers]
thresh = sum(numbers)/(4*M)
if numbers[M] < thresh:
    print('No')
else:
    print('Yes')

Fixed submission:
N, M = input().split()
N = int(N)
M = int(M)
numbers = input().split()
numbers = [int(n) for n in numbers]
thresh = sum(numbers)/(4*M)
selected = list(filter(lambda x: x >= thresh, numbers))
if len(selected) >= M:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
#C
N = int(input())
A = list(map(int, input().split()))
for i in range(1,N+1):
    k=A.count(i)
    print(k)

Fixed submission:
import collections
N = int(input())
A = list(map(int, input().split()))
c = collections.Counter(A)
for i in range(1,N+1):
    print(c[i])
Buggy python submission (verdict: Runtime Error):
#D
N=int(input())
S=str(input())
count=0
for i in range(N):
    for j in range(i+1,N):
        for k in range(j+1,N):
            if j-i!=k-j and S[i]!=S[j] and S[i]!=S[k] and S[j]!=S[k]:
                count+=1
print(count)

Fixed submission:
N=str(input())
L=N.count('7')
if L>=1:
    print('Yes')
else :
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
S=str(input())
count=0
for i in range(N-2):
    for j in range(i+1,N-1):
        for k in range(j+1,N):
            if j-i!=k-j and S[i]!=S[j] and S[i]!=S[k] and S[j]!=S[k]:
                count+=1
print(count)

Fixed submission:
N=int(input())
S=list(str(input()))
r=S.count('R')
g=S.count('G')
b=S.count('B')
count=0

for i in range(int((N-3)/2)+1):
    for k in range(N-i*2-3+1):
        if S[k]!=S[k+i+1] and S[k]!=S[k+2*i+2] and S[k+i+1]!=S[k+2*i+2]:
            count+=1
print(r*g*b-count)

Buggy python submission (verdict: Time Limit Exceeded):
#D
N=int(input())
S=str(input())
count=0
for i in range(N):
    for j in range(i+1,N):
        for k in range(j+1,N):
            if j-i!=k-j and S[i]!=S[j] and S[i]!=S[k] and S[j]!=S[k]:
                count+=1
print(count)

Fixed submission:
N=int(input())
S=list(str(input()))
r=S.count('R')
g=S.count('G')
b=S.count('B')
count=0

for i in range(int((N-3)/2)+1):
    for k in range(N-i*2-3+1):
        if S[k]!=S[k+i+1] and S[k]!=S[k+2*i+2] and S[k+i+1]!=S[k+2*i+2]:
            count+=1
print(r*g*b-count)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
S=list(str(input()))
count=0
for i in range(N):
    for j in range(i+1,N):
        for k in range(j+1,N):
            if j-i!=k-j and S[i]!=S[j] and S[i]!=S[k] and S[j]!=S[k]:
                count+=1
print(count)

Fixed submission:
N=int(input())
S=list(str(input()))
r=S.count('R')
g=S.count('G')
b=S.count('B')
count=0

for i in range(int((N-3)/2)+1):
    for k in range(N-i*2-3+1):
        if S[k]!=S[k+i+1] and S[k]!=S[k+2*i+2] and S[k+i+1]!=S[k+2*i+2]:
            count+=1
print(r*g*b-count)