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

Fixed submission:
from collections import deque
import itertools
h,w=map(int,input().split())
s=["#"+input()+"#" for i in range(h)]
s.insert(0,'#'*(w+2))
s.append('#'*(w+2))
def dep(s,t,p,q,time):
    print(s)
    s[p][q]=min(time,s[p][q])
    time+=1
    if t[p+1][q]=="." :
        dep(s,t,p+1,q,time)
    if t[p-1][q]=="." :
        dep(s,t,p-1,q,time)
    if t[p][q+1]=="." :
        dep(s,t,p,q+1,time)
    if t[p][q-1]=="." :
        dep(s,t,p,q-1,time)
    return max(itertools.chain.from_iterable(s))

m=0
for i in range(h):
    for j in range(w):
        if s[i+1][j+1]=='.':
            t=[[-1 for l in range(w+2)] for l2 in range(h+2)]
            time=0
            q1=deque([])
            t[i+1][j+1]=time
            q1.appendleft([i+1,j+1])
            while len(q1)!=0:
                q=q1.pop()
                time=t[q[0]][q[1]]+1
                if s[q[0]+1][q[1]]=='.' and t[q[0]+1][q[1]]==-1:
                    t[q[0]+1][q[1]]=time
                    q1.appendleft([q[0]+1,q[1]])
                if s[q[0] - 1][q[1]] == '.' and t[q[0]-1][q[1]] == -1:
                    t[q[0] - 1][q[1]] = time
                    q1.appendleft([q[0] - 1, q[1]])
                if s[q[0]][q[1]+1] == '.' and t[q[0]][q[1]+1] == -1:
                    t[q[0] ][q[1]+1] = time
                    q1.appendleft([q[0] , q[1]+1])
                if s[q[0]][q[1]-1] == '.' and t[q[0]][q[1]-1] == -1:
                    t[q[0] ][q[1]-1] = time
                    q1.appendleft([q[0], q[1]-1])
            m=max(max(itertools.chain.from_iterable(t)),m)
print(m)

Buggy submission (verdict: Runtime Error):
from collections import deque
import itertools
h,w=map(int,input().split())
s=["#"+input()+"#" for i in range(h)]
s.insert(0,'#'*(w+2))
s.append('#'*(w+2))
def dep(s,t,p,q,time):
    print(s)
    s[p][q]=min(time,s[p][q])
    time+=1
    if t[p+1][q]=="." :
        dep(s,t,p+1,q,time)
    if t[p-1][q]=="." :
        dep(s,t,p-1,q,time)
    if t[p][q+1]=="." :
        dep(s,t,p,q+1,time)
    if t[p][q-1]=="." :
        dep(s,t,p,q-1,time)
    return max(itertools.chain.from_iterable(s))

m=0
for i in range(h):
    for j in range(w):
        if s[i+1][j+1]=='.':
            t=[[-1 for l in range(w+2)] for l2 in range(h+2)]
            time=0
            q1=deque([])
            t[i+1][j+1]=time
            q1.appendleft([i+1,j+1])
            while len(q1)!=0:
                q=q1.pop()
                time=t[q[0]][q[1]]+1
                if s[q[0]+1][q[1]]=='.' and t[q[0]][q[1]]==-1:
                    t[q[0]+1][q[1]]=time
                    q1.appendleft([q[0]+1,q[1]])
                if s[q[0] - 1][q[1]] == '.' and t[q[0]-1][q[1]] == -1:
                    t[q[0] - 1][q[1]] = time
                    q1.appendleft([q[0] - 1, q[1]])
                if s[q[0]][q[1]+1] == '.' and t[q[0]][q[1]+1] == -1:
                    t[q[0] ][q[1]+1] = time
                    q1.appendleft([q[0] , q[1]+1])
                if s[q[0]][q[1]-1] == '.' and t[q[0]][q[1]-1] == -1:
                    t[q[0] + 1][q[1]-1] = time
                    q1.appendleft([q[0], q[1]-1])
            m=max(itertools.chain.from_iterable(t),m)
print(m)
Problem p02844 (python)

Fixed submission:
import bisect
n=int(input())
s=input()
t=[[] for i in range(10)]
for i in range(n):
    t[int(s[i])].append(i)
c=0
for i in range(10):
    if len(t[i])==0:
        continue
    for j in range(10):
        if len(t[j]) == 0:
            continue
        m=bisect.bisect(t[j],t[i][0])
        if len(t[j])==m:
            continue
        for k in range(10):
            if len(t[k]) == 0:
                continue
            n=bisect.bisect(t[k],t[j][m])
            if len(t[k])==n:
                continue
            else:
                c+=1
print(c)

Buggy submission (verdict: Runtime Error):
import bisect
n=int(input())
s=input()
t=[[] for i in range(10)]
for i in range(n):
    t[int(s[i])].append(i)
c=0
for i in range(10):
    if len(t[i])==0:
        continue
    for j in range(10):
        m=bisect.bisect(t[j],t[i][0])
        if len(t[j])==m:
            continue
        for k in range(10):
            n=bisect.bisect(t[k],t[j][m])
            if len(t[k])==n:
                continue
            else:
                c+=1
prin
Problem p02934 (python)

Fixed submission:
n=int(input())
A=list(map(int,input().split()))
s=0
for i in A:
 s+=1/i
print(1/s)

Buggy submission (verdict: Runtime Error):
n=int(input())
A=[map(int,input().split())]
s=0
for i in A:
 s+=1/i
print(1/s)
Problem p02946 (python)

Fixed submission:
a,b=map(int,input().split())
for i in range(2*a-1):
 print(b-a+i+1)
 print(' ')

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
for i in range(2*a-1)
 print(b-a+i+1)
 print(' ')
Problem p03254 (python)

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

s = 0
num = 0
if x>sum(a):
  print(len(a)-1)
else:
  for i in range(len(a)):
      if x >= a[i]:
          x -= a[i]
          num += 1
      else:
          break

  print(num)

Buggy submission (verdict: Runtime Error):
n,x=map(int,input().split())
a=sort(list(map(int,input().split())))

s=0
num=0
for i in range(len(a)):
  if x>=a[i]:
    x-=a[i]
    num+=1
  else:
    break
    
print(num)
Problem p03262 (python)

Fixed submission:
import fractions
n,x=map(int,input().split())
pl=sorted(list(map(int,input().split()))+[x])
ans=abs(pl[1]-pl[0])
if len(pl)>1:
    for i in range(len(pl)-2):
        ans=fractions.gcd(ans,abs(pl[i+2]-pl[i+1]))
print(ans)

Buggy submission (verdict: Runtime Error):
import math
n,x=map(int,input().split())
pl=sorted(list(map(int,input().split()))+[x])
ans=abs(pl[1]-pl[0])
if len(pl)>1:
    for i in range(len(pl)-2):
        ans=math.gcd(ans,abs(pl[i+2]-pl[i+1]))
print(ans)

Buggy submission (verdict: Runtime Error):
import math
n,x=map(int,input().split())
pl=list(map(int,input().split()))
ans=abs(pl[1]-pl[0])
if len(pl)>1:
    for i in range(len(pl)-2):
        ans=math.gcd(ans,abs(pl[i+2]-pl[i+1]))
print(ans)
Problem p02582 (python)

Fixed submission:
temp = str(input())
count = 0
max_count = 0 

for i in temp:
  if i == 'R':
    count = count + 1
    max_count = count
  else:
    if max_count < count:
      max_count = count
    count = 0
    
print(max_count)

Buggy submission (verdict: Runtime Error):
temp = str(input())
count = 0
 
for i in temp:
  if i == 'R':
    count = count + 1
    max_count = count
  else:
    if max_count < count:
      max_count = count
    count = 0
    
print(max_count)

Buggy submission (verdict: Runtime Error):
temp = str(input())
count = 0
 
for i in temp:
  if i == 'R':
    count = count + 1
  else:
    max_count = count
    count = 0
    
print(max_count)

Buggy submission (verdict: Runtime Error):
temp = str(input())
count = 0

for i in temp:
  if i == R:
    count = count + 1
  else:
    count = 0
    
print(count)
Problem p02641 (python)

Fixed submission:
X,N = map(int, input().split())
try:
  p = list(map(int, input().split()))
except EOFError:
  p = []
  
int_list = [i for i in range(102)]
forbidden_list = sorted(list(set(int_list) - set(p)))
num_X = int_list.index(X)
c = 10000000
 
if X in forbidden_list:
  print(X)
else:
  for i in range(len(forbidden_list) - 1):
    a = abs(X - forbidden_list[i])
    b = abs(X - forbidden_list[i + 1])
    if a == b:
      print(forbidden_list[i])
      break
    elif c > a:
      c = a
    elif c <= a and b >= a:
      print(forbidden_list[i - 1])
      break
    elif b < a:
      print(forbidden_list[i])
      break
  else:
    if a < b:
      print(forbidden_list[i])
    else:
      print(forbidden_list[i + 1])

Buggy submission (verdict: Runtime Error):
X,N = map(int, input().split())
try:
  p = list(map(int, input().split()))
except EOFError:
  p = []

int_list = [i for i in range(1,101)]
forbidden_list = list(set(int_list) - set(p))
num_X = int_list.index(X)
c = 10000000

if X in forbidden_list:
  print(X)
else:
  for i in range(len(forbidden_list) - 1):
    a = abs(X - forbidden_list[i])
    b = abs(X - forbidden_list[i + 1])
    if a == b:
      print(forbidden_list[i])
      break
    elif c > a:
      c = a
    elif c <= a and b > a:
      print(forbidden_list[i - 1])
      break
    else:
      print(forbidden_list[i])
      break
  else:
    print(forbidden_list[-1])
Problem p02717 (python)

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

print(C,A,B)

Buggy submission (verdict: Runtime Error):
A,B,C = map(int(input().slice()))

print(C,A,B)

Buggy submission (verdict: Runtime Error):
A,B,C = map(int(input().slice()))

print(C,A,B)
Problem p02741 (python)

Fixed submission:
k = int(input())

list = []
list = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(list[k-1])

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

list = []
list = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(list[k-1])
Problem p03494 (python)

Fixed submission:
N = int(input())
A_list = list(map(int, input().split()))
count = 0

while (True):
    exist_odd = False
    for i in range(N):
        if (A_list[i] % 2) != 0:
            exist_odd = True

    if exist_odd:
        break
    
    for i in range(N):
        A_list[i] = A_list[i] / 2

    count = count + 1

print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
A_list = [map(int, input().split())]
count = 0

while (True):
    exist_odd = False
    for i in range(N):
        if A_list[i] % 2 != 0:
            exist_odd = True

    if exist_odd:
        break
    
    for i in range(N):
        A_list[i] = A_list[i] / 2

    count = count + 1

print(count)
Problem p02741 (python)

Fixed submission:
K = int(input())

t = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(t[K - 1])

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

t = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(t[K + 1])
Problem p02743 (python)

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

if 4 * a * b < (c - a- b)**2 and c - a- b > 0:
    print("Yes")
else:
    print("No")

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

a = int(a)
b = int(b)
c = int(c)

import math

if abs(math.sqrt(c) - math.sqrt(b) - math.sqrt(a)) > 1e-30:
    if math.sqrt(c) - math.sqrt(b) - math.sqrt(a) > 0:
        print('Yes')
    else:
        print('No')
else:
    t = random.random()
    if t > 0.5:
        print('Yes')
    else:
        print('No')

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

a = int(a)
b = int(b)
c = int(c)

import math

if abs(math.sqrt(c) - math.sqrt(b) - math.sqrt(a)) > 1e-10:
    if math.sqrt(c) - math.sqrt(b) - math.sqrt(a) > 0:
        print('Yes')
    else:
        print('No')
else:
    d = math.sqrt(c) * 1e10
    e = math.sqrt(b) * 1e10
    f = math.sqrt(a) * 1e10
    if math.sqrt(c\d) - math.sqrt(e) - math.sqrt(f) > 0:
        print('Yes')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
a,b,c = input().split()
 
import math
 
a = int(a)
b = int(b)
c = int(c)
 
if math.isclose(math.sqrt(c) - math.sqrt(b) - math.sqrt(a), 0, abs_tol=1e-10):
    print('Yes')
else:
    print('No')

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

import math
 
a = int(a)
b = int(b)
c = int(c)
 
if math.isclose(math.sqrt(c) - math.sqrt(b) - math.sqrt(a), 0, abs_tol=1e-10):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import math

a,b,c = input().split()

a = int(a)
b = int(b)
c = int(c)

if math.isclose(math.sqrt(c) - math.sqrt(b) - math.sqrt(a), 0, abs_tol=1e-10):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
a,b,c = input().split()
 
a = int(a)
b = int(b)
c = int(c)
 
import math
 
if (math.sqrt(a/c) + math.sqrt(b/c) < 1:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
a,b,c = input().split()
 
a = int(a)
b = int(b)
c = int(c)
 
import math
 
if ((math.sqrt(a/(c)**2) + math.sqrt(b/(c)**2)) < 1:
    print('Yes')
else:
    print('No')

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

a = int(a)
b = int(b)
c = int(c)

import math

if ((math.sqrt(a/c**2) + math.sqrt(/c**2)) < 1:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
a,b,c = input().split()
 
a = int(a)
b = int(b)
c = int(c)
 
import math
 
if ((math.sqrt(a) + math.sqrt(b)) / math.sqrt(c)) ** 1000000 < 1:
    print('Yes')
else:
    print('No')
Problem p02755 (python)

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

ans = -1
for i in range(10,12501):
    if int(i*0.08) == a and int(i * 0.1) == b:
        ans = i
        break
        
print(ans)

Buggy submission (verdict: Runtime Error):
import math

a,b = input().split()

B_low = math.ceil(b * 10)
A_high = math.floor((a+1) * 12.5)

if A_high < B_low:
    print('-1')
else:
    print(B_low)
Problem p02848 (python)

Fixed submission:
n = int(input())
 
s = input()
 
alphabet = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
 
ans = ""
for i in range(len(s)):
    num = (alphabet.index(s[i]) + n) % len(alphabet)
    ans += alphabet[num]
    
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
 
s = input()
 
alphabet = ["A","B","C","D","E","F","G","H","I","J","K","L","M","M","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
 
ans = ""
for i in range(len(s)):
    num = (alphabet.index(s[i]) + n) % len(alphabet)
    ans += alphabet[num]
    
print(ans)

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

s = input()

alphabet = ["A","B","C","D","E","F","G","H","I","J","K","L","M","M","O","P","Q","R","S","T","U","V","W","X","Y","Z"]

ans = ""
for i in range(len(s)):
    num = ( alphabet.index(s[i]) + n ) % len(alphabet)
    ans += alphabet[num]
    
print(ans)

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

n = int(input())

alphabet = ["A","B","C","D","E","F","G","H","I","J","K","L","M","M","O","P","Q","R","S","T","U","V","W","X","Y","Z"]

ans = ""
for i in range(len(s)):
    num = ( alphabet.index(s[i]) + n ) % 26
    ans += alphabet[num]
    
print(ans)
Problem p03557 (python)

Fixed submission:
import bisect

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
 
A.sort()
C.sort()
 
ans = 0
for i in range(N):
    a = bisect.bisect_left(A, B[i])
    c = bisect.bisect_right(C, B[i])
    ans += a*(N-c)
print(ans)

Buggy 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.sort()
C.sort()
 
ans = 0
for i in range(n):
    a = bisect.bisect_left(A, B[i])
    c = bisect.bisect_right(C, B[i])
    ans += a*(N-c)
print(ans)
Problem p02732 (python)

Fixed submission:
from __future__ import print_function

import array
import bisect
import collections
import copy
import fractions
import functools
import heapq
import itertools
import math
import operator
import random
import re
import string
import sys
import time
from collections import Counter, deque
from fractions import Fraction
from functools import reduce
from heapq import heapify, heappop, heappush, heappushpop, heapreplace
from itertools import accumulate
from operator import mul
from queue import PriorityQueue as pq
from queue import Queue

sys.setrecursionlimit(500000)









input = sys.stdin.readline


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return

# from fractions import gcd
# from math import gcd

# def lcm(n, m):
#     return int(n * m / gcd(n, m))


# def coprimize(p, q):
#     common = gcd(p, q)
#     return (p // common, q // common)


# def find_gcd(list_l):
#     x = reduce(gcd, list_l)
#     return x


def combinations_count(n, r):
    if r>n:
        return 0
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom


def main():
    n = int(input().strip())
    a = list(map(int, input().strip().split()))
    C=Counter()
    for i in range(n):
        C[a[i]]+=1
    ans_temp=0
    X=[0 for _ in range(n+1)]
    for key, value in C.items():
        X[key] = combinations_count(value, 2)
        ans_temp += X[key]
    for k in range(n):
        print( ans_temp - X[a[k]] + combinations_count(C[a[k]]-1,2) )


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
input = sys.stdin.readline

from collections import Counter

#
n = int(input().strip())
a = list(map(int, input().strip().split()))

#
C=Counter()
for i in range(n):
    C[a[i]] += 1
xsum=0
for key, value in C.items():
    xsum += value*(value-1)//2

#
for k in range(n):
    print( xsum - (C[a[k]] - 1) )
Problem p03069 (python)

Fixed submission:
from __future__ import print_function
import numpy as np
import sys

def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)

n=int(input())
S=list(input())
array0=np.zeros(n,dtype=int)
array1=np.zeros(n,dtype=int)
array2=np.zeros(n,dtype=int)

array0[0]= 1 if S[0]=='#' else 0
for i in range(1,n):
    array0[i]= array0[i-1]+1 if S[i]=='#' else array0[i-1]


array1[n-1]= 1 if S[n-1]=='.' else 0
for i in range(n-2,-1,-1):
    array1[i]= array1[i+1]+1 if S[i]=='.' else array1[i+1]
    
for i in range(0,n):
    array2[i]=array0[i]+array1[i]
eprint(array0)
eprint(array1)
eprint(array2)
    
print(min(array2)-1)
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#

Buggy submission (verdict: Runtime Error):
from __future__ import print_function
import sys

def # eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)


n=int(input())
S=list(input())

cnt_temp=0
cnt_temp2=0
stack=[]
cnt=0

# # eprint(n)
# # eprint(S)

# for i in range(n):
#     # eprint(i)


flag=0
flag2=0
start=0

for i in range(n):
    if S[i] == '.':
        cnt_temp+=1



if S[0] == '.':
    flag =1
# eprint("flag: ",end="")
# eprint(flag)

if flag==1:
    for i in range(n-1):
        if S[i]=='#' and S[i+1]=='.':
            flag2=1
            for j in range(i+1,n):
                if S[j] =='.':
                    cnt_temp2+=1
            break
# eprint("flag2: ",end="")
# eprint(flag2)
        

        
for _ in S:
    print( _ , end="")
print()
        
for i in range(n-1):
    if S[i]=='#' and S[i+1]=='#':
        stack.append(i)
    elif S[i]=='#' and S[i+1]=='.':
        
        S[i]='.'
        cnt+=1
        
        for _ in S:
            # eprint(_,end="")
        # eprint()
        
        
        
        while stack!=[]:
            temp=stack.pop()
            S[temp]='.'
            cnt+=1
            for _ in S:
                # eprint(_,end="")
            # eprint()

            
        
# eprint("cnt: ",end="")
# eprint(cnt)
# eprint("cnt_temp2: ",end="")
# eprint(cnt_temp2)

print(min(cnt,cnt_temp,cnt_temp2))
            #
    #
    #
    #
    #
    #
    #
    #
    #
    #
    #
    #
    #
    #
    #
    #
Problem p03087 (python)

Fixed submission:
from __future__ import print_function
import sys
import numpy as np

def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)

N,Q = map(int,input().split())  # Nは文字列Sの長さ．Qは質問の個数．
S = input()
S=S+"0"

cnt=np.zeros(100000,dtype='int')
now_x=0
for i in range(1,N):
    if S[i-1]=='A' and S[i]=='C':
        cnt[i]=now_x+1
        now_x=cnt[i]
    else:
        cnt[i]=now_x

for i in range(Q):
    left,right=map(int,input().split())
    left-=1
    right-=1
    print(cnt[right]-cnt[left])
    #
    #
    #
    #
    #
    #
    #
    #
    #
    #
    #
    #
    #
    #
    #
    #

Buggy submission (verdict: Runtime Error):
from __future__ import print_function
import sys
import numpy as np

def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)

N,Q = map(int,input().split())  # Nは文字列Sの長さ．Qは質問の個数．
S = input()
S=S+"0"

cnt=np.zeros(100000)
now_x=0
for i in range(1,N+1):
    if S[i-1]=='A' and S[i]=='C':
        cnt[i]=now_x+1
        now_x=cnt[i]
    else:
        cnt[i]=now_x

for i in range(Q):
    left,right=map(int,input().split())
    left-=1
    right-=1
    print(cnt[right]-cnt[left])
    #
    #
    #
    #
    #
    #
    #
    #
    #
    #
    #
    #
    #
    #
    #
    #
Problem p03796 (python)

Fixed submission:
from __future__ import print_function

import sys
input = sys.stdin.readline

def main():
    n = int(input().strip())
    temp = 1
    for i in range(1, n + 1):
        temp *= i
        temp = temp % (10**9 + 7)
    print(temp)
    return


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
from __future__ import print_function

import sys
input = sys.stdin.readline


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return


# import re
# import array
# import copy
# import functools
# import operator

# import math
# import string
# import fractions
# from fractions import Fraction
# from fractions import gcd
from math import gcd
# import collections
# import itertools
# import bisect

# import heapq
# from heapq import heappush
# from heapq import heappop
# from heapq import heappushpop
# from heapq import heapify
# from heapq import heapreplace
# from queue import PriorityQueue as pq
from queue import Queue

# from itertools import accumulate

# from collections import deque
# from collections import Counter

# from operator import mul
# from functools import reduce

# def lcm(n,m):
#     return int(n*m/gcd(n,m))

# def reduce(p, q):
#     common = fractions.gcd(p, q)
#     return (p//common , q//common )

# def combinations_count(n, r):
#     r = min(r, n - r)
#     numer = reduce(mul, range(n, n - r, -1), 1)
#     denom = reduce(mul, range(1, r + 1), 1)
#     return numer // denom

# import random
# import time


def main():
    n = int(input().strip())
    temp = 1
    for i in range(1, n + 1):
        temp *= i
        temp = temp % (10**9 + 7)
    print(temp)
    return


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
from __future__ import print_function

import sys
input = sys.stdin.readline


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return


# import re
# import array
# import copy
# import functools
# import operator

# import math
# import string
# import fractions
# from fractions import Fraction
# from fractions import gcd
from math import gcd
# import collections
# import itertools
# import bisect

# import heapq
# from heapq import heappush
# from heapq import heappop
# from heapq import heappushpop
# from heapq import heapify
# from heapq import heapreplace
# from queue import PriorityQueue as pq
from queue import Queue

# from itertools import accumulate

# from collections import deque
# from collections import Counter

# from operator import mul
# from functools import reduce

# def lcm(n,m):
#     return int(n*m/gcd(n,m))

# def reduce(p, q):
#     common = fractions.gcd(p, q)
#     return (p//common , q//common )

# def combinations_count(n, r):
#     r = min(r, n - r)
#     numer = reduce(mul, range(n, n - r, -1), 1)
#     denom = reduce(mul, range(1, r + 1), 1)
#     return numer // denom

# import random
# import time


def main():
    n = int(input().strip())
    temp = 1
    for i in range(1, n + 1):
        temp *= i
        temp = temp % (10**9 + 7)
    print(temp)
    return


if __name__ == '__main__':
    main()
Problem p03477 (python)

Fixed submission:
def libra(l,r):
    if l>r:
        return "Left"
    elif l == r:
        return "Balanced"
    else:
        return "Right"
def sum(a,b):
    c = a+b
    return c
a,b,c,d=[int(i) for i in input().split()]
print(libra(sum(a,b),sum(c,d)))

Buggy submission (verdict: Runtime Error):
def libra(l,r):
    if l>r:
        return "Left"
    elif l == r:
        return "Balanced"
    else:
        return "Right"
def sum(a,b):
    c = a+b
    return c

a,b,c,d=[int() for  in input().split()]
print(libra(sum(a,b),sum(c,d)))