Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p02891 (python)

Fixed submission:
# A - Connection and Disconnection
def count(s, c):
	count_ = s.count(c*2)
	
	while c*3 in s:
		s = s.replace(c*3, c+'_'+c)
	
	while c*2 in s:
		s = s.replace(c*2, c+'_')
	
	return min(count_, s.count('_'))


def get_startswith(s, c):
	key = c
	
	while s.startswith(key+c):
		key += c
	
	return len(key)
	
	
def get_endswith(s, c):
	key = c
	
	while s.endswith(key+c):
		key += c
	
	return len(key)


import string

S = input()
K = int(input())

lower = string.ascii_lowercase
ans = 0

if S[0] == S[-1:]:
	start = get_startswith(S, S[0])
	end = get_endswith(S, S[0])	
	
	if start == end == len(S):
		print(len(S) * K // 2)
	else:
		ans = 0
		
		ans += start // 2
		ans += end // 2
		ans += ((start + end) // 2) * (K - 1)
		
		for c in lower:
			ans += count(S[start:len(S)-end], c) * K

		print(ans)	
else:
	for c in lower:
		ans += count(S, c)

	print(ans * K)

Buggy submission (verdict: Runtime Error):
import sys

# A - Connection and Disconnection
import string

S = input()
K = int(input())
T = S + S[0]

lower = string.ascii_lowercase
ans = 0
is_specila_case = False

for c in lower:
	key = c * 2
	ans += T.count(key)

	if T.endswith(key):
		is_specila_case = True

ans *= K

if is_specila_case:
	print(ans - 1)
else:
	print(ans)import sys

# A - Connection and Disconnection
import string

S = input()
K = int(input())
T = S + S[0]

lower = string.ascii_lowercase
ans = 0
is_specila_case = False

for c in lower:
	key = c * 2
	ans += T.count(key)

	if T.endswith(key):
		is_specila_case = True

ans *= K

if is_specila_case:
	print(ans - 1)
else:
	print(ans)
Problem p02595 (python)

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

s = 0

for i in range(n):
    x,y = map(int,input().split())
    if x**2 + y**2 <= d**2:
        s += 1
print(s)

Buggy submission (verdict: Runtime Error):

for i in range(n):
    x,y = map(int,input().split())
    if x**2 + y**2 <= d**2:
        s += 1
print(s)
Problem p02623 (python)

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

A,B = [0],[0]

for i in range(n):
    A.append(A[i] + a[i])
for i in range(m):
    B.append(B[i] + b[i])

ans,j = 0,m

for i in range(n+1):
    if A[i] > k:
        break
    while B[j] > k - A[i]:
        j -= 1
    ans = max(ans,i+ j)
print(ans)

Buggy submission (verdict: Runtime Error):
n,m,k = map(int,input().split())

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

s = 0
t = 0
for i in range(n+m):
    if a != []:
        if a[0] <= b[0]:
            c = a[0]
            a.pop(0)
        else:
            c = b[0]
            b.pop(0)
    else:
        c = b[0]
        b.pop(0)
    if s+c>k:
        break
    else:
        s += c
        t += 1
print(t)

Buggy submission (verdict: Runtime Error):
n,m,k = map(int,input().split())

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

s = 0
t = 0
for i in range(n+m):
    if a != []:
        c = min(a[0],b[0])
        if c == a[0]:
            a.pop(0)
        else:
            b.pop(0)
    else:
        c = b[0]
        b.pop(0)
    if k-c < s:
        break
    else:
        s += c
        t += 1
print(t)
Problem p02723 (python)

Fixed submission:
s = input()

if s[2] == s[3] and s[4]== s[5]:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s = input()

if s[2] == s[3] and s[4]== s[5]:
	print(‘Yes’)
else:
	print(‘No’)
Problem p02594 (python)

Fixed submission:
#at coder ABC174 A
X = int(input())
if X >= 30:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
for i in input:
    if i >= 30:
        print('Yes')
    else:
        print('No')
Problem p03631 (python)

Fixed submission:
n = list(input())
if n[0] ==n[2]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = list(int,input())
m = n.sort(reverse=True)
if n == m:
    print("Yes")
else:
    print("No")
Problem p02682 (python)

Fixed submission:
#python 3.7.1

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

k=d

if(a-k>0):

  print(k)

else:

  k=d-a

  if(b-k>0):

    print(a)

    

  else:

    k=d-a-b

    print(a-k)

Buggy submission (verdict: Runtime Error):
#python 3.7.1

a=int(input())

b=int(input())

c=int(input())

d=int(input())

cnt=0

while(d!=0):

  

  if(a!=0 and d>0):

    d-=1

    a=a-1

    

    cnt=cnt+1

    

  elif b!=0 and d>0:

    d-=1

    b=b-1

    

    

  elif c!=0 and d>0:

    d-=1

    c=c-1

    

    cnt=cnt-1

    

print(cnt)
Problem p02676 (python)

Fixed submission:
K = int(input())
S = input()
if len(S) > K:
  print(S[0:K] + '...')
else:
  print(S)

Buggy submission (verdict: Runtime Error):
S = input()
K = int(input())
if len(S) >= K:
  print(S[0:K] + '...')
else:
  print(S)

Buggy submission (verdict: Runtime Error):
S = input()
K = int(input())
if len(S) > K:
  print(S[:K] + '...')
else:
  print(S)

Buggy submission (verdict: Runtime Error):
S = input()
K = int(input())
if len(S) >= K:
  print(S[:K] + '...')
else:
  print(S)

Buggy submission (verdict: Runtime Error):
S = input()
K = int(input())
if len(S) <= K:
  print(S[:K] + '...')
else:
  print(S)
Problem p02759 (python)

Fixed submission:
UNKO = int(input())
print(UNKO // 2 + UNKO % 2)

Buggy submission (verdict: Runtime Error):
N = int((input())

if N % 2 == 0:
  print(N / 2)
else:
  print(N // 2 + 1)

Buggy submission (verdict: Runtime Error):
N = int((input())

if N % 2 == 0:
  print(N // 2)
else:
  print((N // 2) + 1)

Buggy submission (verdict: Runtime Error):
N = int((input())

if N % 2 == 0:
  print(N / 2)
else:
  print((N / 2) + 1)

Buggy submission (verdict: Runtime Error):
N = input()

if N % 2 == 0:
  unpo = N / 2
  print(unpo)
else:
  unpo = (N / 2) + 1
  print(unpo)
Problem p02771 (python)

Fixed submission:
A, B, C = input().split(' ')
if (A == B == C) or (A!= B != C != A):
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
A, B, C = int(input().split(' '))
if A == B == C or A!= B != C:
  print('No')
else:
  print('Yes')
Problem p02773 (python)

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

ans = {}
for i in S:
  if i in ans:
    ans[i] += 1
  else:
    ans[i] = 1

max_value = max(ans.values())
ANS = []
for key, value in ans.items():
  if ans[key] == max_value:
    ANS.append(key)
    
for i in sorted(ANS):
  print(i)

Buggy submission (verdict: Runtime Error):
N = input().split(' ')
S = [input() for i in range(N)]

ans = {}
for i in S:
  if i in ans:
    ans[i] += 1
  else:
    ans[i] = 1

max_value = max(ans.value())
ANS = []
for key, value in ans.item():
  if ans[key] == max_value:
    ANS.append(key)
    
for i in sorted(ANS):
  print(i)
Problem p02777 (python)

Fixed submission:
S, T = input().split()
A, B = map(int, input().split())
U = input()

if S == U:
  print(A - 1, B)
else:
  print(A, B - 1)

Buggy submission (verdict: Runtime Error):
S, T = str(input().split())
A, B = map(int, input().split())
U = str(input())

if S == U:
  print(A - 1, B)
if T == U:
  print(A, B - 1)

Buggy submission (verdict: Runtime Error):
S, T = str(input().split(' '))
A, B = int(input().split(' '))
U = str(input())

if S == U:
  A -= 1
if T == U:
  B -= 1
print(A, B)

Buggy submission (verdict: Runtime Error):
S, T, U = str(input().split(' '))
A, B = int(input().split(' '))

if S == U:
  A -= 1
if T == U:
  B -= 1
print(A, B)
Problem p02859 (python)

Fixed submission:
r = int(input())

print(r**2)

Buggy submission (verdict: Runtime Error):
r = input()

print(r ** 2)
Problem p02860 (python)

Fixed submission:
N = int(input())
S = str(input())

if N % 2 == 0:
    T = S[:int(N/2)]
    if S == T + T:
        print('Yes')
    else:
      print('No')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
S = str(input())

if N % 2 == 0:
    T = str(S[:N/2])
    if S == T + T:
        print('Yes')
    else:
      print('No')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
S = str(input())

if N % 2 == 0:
    T = S[:N/2]
    if S == T + T:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
S = str(input())

if N % 2 == 0:
    T = S[:N/2]
    if S == T + T:
        print('Yes')
    else:
      print('No')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
S = str(input())

if N % 2 == 0:
    T = S[:N/2]
    if S == T + T:
        print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
S = str(input())

if N % 2 != 0:
  print('No')

if S[:N / 2] == S[N / 2:]:
  print('Yes')

Buggy submission (verdict: Runtime Error):
N = int(input())
S = str(input())

if N % 2 != 0:
  print('No')

wc = N / 2
wc1 = S[:wc]
wc2 = S[wc:]

if wc1 == wc2:
  print('Yes')
Problem p02793 (python)

Fixed submission:
#from math import gcd
from fractions import gcd
from functools import reduce

mod = 10**9 + 7

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


N = int(input())
A = [i for i in map(int, input().split())]

ans = reduce(lcm, A)

#print(ans)
B = [ans//i for i in A]

print(sum(B) % mod)

Buggy submission (verdict: Runtime Error):
#from math import gcd
from fractions import gcd
from functools import reduce
import numpy as np
import sys
#import time

"""
def input():
    return sys.stdin.readline()[:-1]
"""

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

def main():
	mod = 10**9 + 7
	N = int(input())
	A = list(map(int, input().split()))

	ans = reduce(lcm, A)
	"""
	a = 1
	for i in A:
		a = lcm(a, i)
	"""
	#print(a, ans)
	B = np.array([ans//i for i in A])
	print(np.sum(B) % mod)

if __name__ == "__main__":
	main()

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce

mod = 10**9 + 7

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


N = int(input())
A = [i for i in map(int, input().split())]

ans = reduce(lcm, A)

B = [ans//i for i in A]

print(sum(B) % mod)

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce

mod = 10**9 + 7

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


N = int(input())
A = [i for i in map(int, input().split())]

ans = reduce(lcm, A)


B = [ans//i for i in A]

ans = reduce(math.gcd, B)
if ans != 1:
	B_ = [i//ans for i in B]
	print(sum(B_) % mod)
else:
	print(sum(B) % mod)

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce

mod = 10**9 + 7

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


N = int(input())
A = [i for i in map(int, input().split())]

ans = reduce(lcm, A)

B = [ans//i for i in A]
print(sum(B) % mod)
Problem p02831 (python)

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

def gcd(x, y):
	while y!=0:
		x, y = y , x%y
	return x

def lcm(x, y):
	return (x * y) // gcd(x, y)

print(lcm(a, b))

Buggy submission (verdict: Runtime Error):
import math

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

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(a, b))
Problem p02771 (python)

Fixed submission:
a,b,c = map(int,input().split())
ans = False
if a == b and b != c:
    ans = True
if b == c and c != a:
    ans = True
if c == a and a != b:
    ans = True
if ans:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
Data = list(map(int,input().split()))
ans = True
for data in Data:
    if data % 2 == 0:
        if data % 3 == 0 or data % 5 == 0:
            pass
        else:
            ans = False
            break
if ans:
    print('APPROVED')
else:
    print('DENIED')
Problem p03011 (python)

Fixed submission:
P,Q,R = map(int,input().split())
print(min(P+Q,min(P+R,Q+R)))

Buggy submission (verdict: Runtime Error):

N,M = map(int,input().split())
step  = [-1] * (N + 1)

for _ in range(M):
    a = int(input())
    step[a-1] = 0

if step[0] == -1:
    step[0] = 1

if step[1] == -1:
    step[1] = step[0]+1

for i in range(2,N):
    if step[i] == -1:
        step[i] = step[i-1]+step[i-2]

print(step[N-1] % 1000000007)
Problem p03013 (python)

Fixed submission:

N,M = map(int,input().split())
step  = [-1] * (N + 1)

for _ in range(M):
    a = int(input())
    step[a-1] = 0

if step[0] == -1:
    step[0] = 1

if step[1] == -1:
    step[1] = step[0]+1

for i in range(2,N):
    if step[i] == -1:
        step[i] = step[i-1]+step[i-2]

print(step[N-1] % 1000000007)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
step  = [-1] * N

for _ in range(M):
    a = int(input())
    step[a-1] = 0

if step[0] == -1:
    step[0] = 1

if step[1] == -1:
    step[1] = step[0]+1

for i in range(2,N):
    if step[i] == -1:
        step[i] = step[i-1]+step[i-2]

print(step[N-1] % 1000000007)
Problem p03036 (python)

Fixed submission:
r,D,xi = map(int,input().split())
for i in range(10):
    xi = r * xi - D
    print(xi)

Buggy submission (verdict: Runtime Error):
r,D,x2000 = map(int,raw_input().split())
xi = x2000
for i in range(1,11):
    xi = r * xi - D
    print(xi)
Problem p03805 (python)

Fixed submission:
import itertools

N,M = map(int,input().split())
Data = []
for _ in range(N+1):
    Data.append([0]*(N+1))
for _ in range(M):
    a,b = map(int,input().split())
    Data[a][b] = 1
    Data[b][a] = 1

ans = 0
for r in itertools.permutations(range(2,N+1)):
    Rlist = list(r)
    a = 1
    b = Rlist[0]
    if Data[a][b] == 0:
        continue
    else:
        flag = True 
        for i in range(len(Rlist)-1):
            a = Rlist[i]
            b = Rlist[i+1]
            if Data[a][b] == 0:
                flag = False
                break
        if flag:
            ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
import itertools

N,M = map(int,input().split())
Data = []
for _ in range(M+1):
    Data.append([0]*(M+1))
for _ in range(M):
    a,b = map(int,input().split())
    Data[a][b] = 1
    Data[b][a] = 1

ans = 0
for r in itertools.permutations(range(2,N+1)):
    Rlist = list(r)
    a = 1
    b = Rlist[0]
    if Data[a][b] == 0:
        continue
    else:
        flag = True 
        for i in range(len(Rlist)-1):
            a = Rlist[i]
            b = Rlist[i+1]
            if Data[a][b] == 0:
                flag = False
                break
        if flag:
            ans += 1

print(ans)
Problem p02676 (python)

Fixed submission:
K=int(input())
S=input()
A=len(S)
if A<=K:
  print(S)
if A>K:
  print(S[0:K:1]+'...')

Buggy submission (verdict: Runtime Error):
K=int(input())
S=input()
A=len(S)
if A=K:
  print(S)
if A>K:
  print(S[0:K:1]+'...')
Problem p02729 (python)

Fixed submission:
n,m=map(int,input().split())
print(int(n*(n-1)/2+m*(m-1)/2))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
print(int(n*(n+1)/2+m*(m+1)/2)
Problem p03803 (python)

Fixed submission:
a,b = map(int,input().split())
if a==b:
  print('Draw')
elif a==1 or b!=1 and a>b:
  print('Alice')
else:
  print('Bob')

Buggy submission (verdict: Runtime Error):
a,b = = map(int,input().split())
if a==1 and b!=1 or a>b:
  print('Alice')
elif b==1 and a!=1 or b>a:
  print('Bob')
else:
  print('Draw')
Problem p02707 (python)

Fixed submission:
n=int(input())
buka = [0]*n
for joushi in input().split():
  buka[int(joushi)-1] += 1
print(*buka,sep='\n')

Buggy submission (verdict: Runtime Error):
n=int(input())
buka = [0]*n
for i in range(n):
  buka[int(input())-1] += 1
print(*buka,sep='/n')
Problem p02725 (python)

Fixed submission:
k,n=map(int,input().split())
a=list(map(int,input().split()))
dist = [k-a[n-1]+a[0]]
for i in range(n-1):
  dist.append(a[i+1]-a[i])

print(k-max(dist))

Buggy submission (verdict: Runtime Error):
k,n=map(int,input().split())
a=list(map(int,input().split()))
dist = [k-dist[n-1]+dist[0]]
for i in range(n):
  dist.append(a[i+1]-a[i])

print(k-max(dist))
Problem p02729 (python)

Fixed submission:
def cmb(n,k):
  x,y=n,k
  for i in range(1,k):
    x*=n-i
    y*=k-i
  return x//y

n,m=[int(x) for x in input().split()]
N=cmb(n,2) if n>=2 else 0
M=cmb(m,2) if m>=2 else 0
print(N+M)

Buggy submission (verdict: Runtime Error):
def cmb(n,k):
  x,y=n,k
  for i in range(1,k):
    x*=n-i
    y*=k-i
  return x//y

n,m=[int(x) for x in input().split()]
N=cmb(m,2) if n>=2 else 0
M=cmb(n,2) if m>=2 eles 0
print(N+M)
Problem p02754 (python)

Fixed submission:
n,a,b=map(int,input().split())
ans=0

se=n//(a+b)
n%=a+b
ans+=se*a + min(a,n)
print(ans)

Buggy submission (verdict: Runtime Error):
n,a,b=map(int,input().split())
ans=0

se=n//(a+b)
n%=a+b
ans+=se*a + min(a,n)
prnit(ans)
Problem p02790 (python)

Fixed submission:
n,m=[int(i) for i in input().split()]
ans=""
if n>=m:
  for i in range(n):
    ans+=str(m)
else:
  for i in range(m):
    ans+=str(n)
print(ans)

Buggy submission (verdict: Runtime Error):
n,m=[int(i) for i in input().split()]
ans=""
if n>=m:
  for i in range(n):
    ans+=m
else:
  for i in range(m):
    ans+=n
print(ans)
Problem p02832 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
now=1
rtn=0
for i in range(n):
    if a[i]==now:
        rtn+=1
        now+=1
if rtn:
    print(n-rtn)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
if not 1 in a:
    print(-1)
else:
    for i in range(1,n):
        if i in a:
            index=a.index(i)
            a=a[index:]
        else:
            break
    print(n-i+1)
Problem p02860 (python)

Fixed submission:
n=int(input())
s=input()
f=True
if n%2==1:
    print('No')
else:
    l=n//2
    for i in range(l):
        if not s[i]==s[i+l]:
            f=False
            break
    if f:
        print('Yes')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
n=input()
s=input()
if s[0]==s[3] and s[1]==s[4] and s[2]==s[5]:
  print('Yes')
else:
  print('No')
Problem p02897 (python)

Fixed submission:
N = int(input())



if N%2==0:
  print(0.5000000000)
else:
  print((N+1)/(2*N))

Buggy submission (verdict: Runtime Error):
n=int(input())
if n%2==0:
  print(1/2)
else:
  print((n+1)/(2*a))

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
B = list(A)

for i in range(N):
  B[i] = A.index(i+1) + 1
  
  
print(*B)
Problem p02933 (python)

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

if a>=3200:
  print(s)
else:
  print('red')

Buggy submission (verdict: Runtime Error):
a=int(input())
s=input()
if s>=3200:
  print(s)
else:
  print('red')
Problem p02951 (python)

Fixed submission:

abc=input().split()
a,b,c=int(abc[0]),int(abc[1]),int(abc[2])
 
print(max(0,c-(a-b)))

Buggy submission (verdict: Runtime Error):
N = int(input())
n=N
c=0
while n>0:
  n//=10
  c+=1

print(c)
if c%2==0:
  print(int((10**c-1)/11))
else: 
  print(int(N-10**(c-1)+1+(10**(c-1)-1)/11))

Buggy submission (verdict: Runtime Error):
abc=input().split()
a,b,c=int(abc[0]),int(abc[1]),int(abc[2])

print(max(0,c-(a-b))
Problem p02987 (python)

Fixed submission:
s=input()
u = set()
for let in s:
  u.add(let)
count=0
for let in s:
  if s[0] == let:
    count += 1
if count ==2 and len(u)==2:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s=input()
u = set()
for let in s:
  u.add(let)
count=0
for let in s:
  if s[0] == let:
    count += 1
if count ==2 and u.size()==2:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s=input()
u = set()
for let in s:
  u.add(let)
count=0
for let in s:
  if s[0] == let:
    count += 1
if count ==2 and u.size()==2:
  print('Yes')
else:
  print('No')
Problem p02552 (python)

Fixed submission:
x = int(input())
if x == 0:
    print(1)
elif x == 1:
    print(0)

Buggy submission (verdict: Runtime Error):
x = input()
x = input()
if x == 0:
    print(1)
elif x == 1:
    print(0)
Problem p02594 (python)

Fixed submission:
if int(input())>=30:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
if int(input())>=30:
    print(Yes)
else:
    print(No)

Buggy submission (verdict: Runtime Error):
if int(input())>=30:
  print(Yes)
else:
  print(No)
Problem p02897 (python)

Fixed submission:
n=int(input())
print((n-n//2)/n)

Buggy submission (verdict: Runtime Error):
n=int(input())
print(1 if n==1 else 0.5+int(input())%2/10)
Problem p03631 (python)

Fixed submission:
N = input()

if N[0] == N[2]:print("Yes")
else:print("No")

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())

print(min(b, d) - max(a, c))
Problem p02847 (python)

Fixed submission:
a = input()
d = {'SUN': 7, 'MON': 6, 'TUE': 5, 'WED': 4, 'THU': 3, 'FRI': 2, 'SAT': 1}
print(d[a])

Buggy submission (verdict: Runtime Error):
in = input()
d = {'SUN': 7, 'MON': 6, 'TUE': 5, 'WED': 4, 'THU': 3, 'FRI': 2, 'SAT': 1}
print(d[in])
Problem p02695 (python)

Fixed submission:
def makeSeqList(N,M,curList,res):
    if len(curList)==N:
        res.append(curList.copy())
        return

    for i in range(1,M+1):
        if len(curList)!=0 and i<curList[-1]:
            continue
        curList.append(i)
        makeSeqList(N,M,curList,res)
        del curList[-1]

def main():
    N,M,Q=map(int,input().split())
    quadList=[]
    for _ in range(Q):
        quadList.append(list(map(int,input().split())))
    res=[]
    makeSeqList(N,M,[],res)
    ans=-1
    for sequence in res:
        summ=0
        for q in quadList:
            if (sequence[q[1]-1]-sequence[q[0]-1])==q[2]:
                summ+=q[3]
        ans=max(ans,summ)
    print(ans)

if __name__=='__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    N,M=map(int,input().split())
    a=1
    b=N-1
    for i in range(1,M+1):
        print(a,b)
        a+=1
        b-=1
if __name__=='__main__':
    main()
Problem p02623 (python)

Fixed submission:
import sys
import bisect
input = sys.stdin.readline
ins = lambda: input().rstrip()
ini = lambda: int(input().rstrip())
inm = lambda: map(int, input().split())
inl = lambda: list(map(int, input().split()))
out = lambda x: print('\n'.join(map(str, x)))

n, m, k = inm()
a = inl()
b = [0] + inl()
count = 0
prev = 0
for i in range(n-1):
    a[i+1] += a[i]
for i in range(m+1):
    if b[i]+prev > k:
        break
    j = bisect.bisect(a, (k - b[i] - prev))
    count = max(count, i + j)
    prev += b[i]
print(count)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
ins = lambda: input().rstrip()
ini = lambda: int(input().rstrip())
inm = lambda: map(int, input().split())
inl = lambda: list(map(int, input().split()))
out = lambda x: print('\n'.join(map(str, x)))

n, m, k = inm()
a = inl()
b = inl()
count = 0
for i in range(n-1):
    a[i+1] += a[i]
for i in range(m-1):
    b[i+1] += b[i]
for i in range(n):
    j = m-1
    if a[i] > k:
        break
    while a[i] + b[j] > k:
        j -= 1
    count = max(count, i+j + 2)
print(count)
Problem p02552 (python)

Fixed submission:
x = int(input())
if x == 0:
 print('1')
elif x == 1:
 print('0')

Buggy submission (verdict: Runtime Error):
if x == 0:
 print('1')
elif x == 1:
 print('0')
Problem p02552 (python)

Fixed submission:
x = int(input())
if x == 1 :
  print(0)
else :
  print(1)

Buggy submission (verdict: Runtime Error):
if x==1 :
  print(0)
else :
  print(1)

Buggy submission (verdict: Runtime Error):
if x==1 :
  print(0)
else print(1)
Problem p02659 (python)

Fixed submission:
a, b=input().split()
a=int(a)
b=int(b[0]+b[2:])
print(int(a*b//100))

Buggy submission (verdict: Runtime Error):
a, b=map(int, input().split())
print(int(a*b))