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

Fixed submission:
n,m=map(int,input().split())
a=[int(input()) for _ in range(m)]
def fb(num):
    a,b = 1,0
    for _ in range(num+1):
        a,b = a+b,a
    return b
if m==0:
    print(fb(n)%(10**9+7))
    exit()
if m>1:
    for i in range(m-1):
        if a[i+1]-a[i]==1:
            print(0)
            exit()
c=0
for i in range(m):
    if i==0 and a[0]==1:
        c+=1
    elif i==0:
        c+=fb(a[0]-1)
    else:
        c*=(fb(a[i]-a[i-1]-2)%(10**9+7))
c*=fb(n-a[-1]-1)%(10**9+7)
print(c%(10**9+7))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=[int(input()) for _ in range(m)]
def fb(num):
    a,b = 1,0
    for _ in range(num+1):
        a,b = a+b,a
    return b
if m=0:
    print(fb(n)%(10**9+7))
    exit()
if m>1:
    for i in range(m-1):
        if a[i+1]-a[i]==1:
            print(0)
            exit()
c=0
for i in range(m):
    if i==0 and a[0]==1:
        c+=1
    elif i==0:
        c+=fb(a[0]-1)
    else:
        c*=(fb(a[i]-a[i-1]-2)%(10**9+7))
c*=fb(n-a[-1]-1)%(10**9+7)
print(c%(10**9+7))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=[int(input()) for _ in range(m)]
def fb(num):
    a,b = 1,0
    for _ in range(num+1):
        a,b = a+b,a
    return b%(10**9+7)
if m=0:
    print(fb(n)%(10**9+7))
    exit()
if m>1:
    for i in range(m-1):
        if a[i+1]-a[i]==1:
            print(0)
            exit()
c=0
for i in range(m):
    if i==0 and a[0]==1:
        c+=1
    elif i==0:
        c+=fb(a[0]-1)
    else:
        c*=(fb(a[i]-a[i-1]-2)%(10**9+7))
c*=fb(n-a[-1]-1)%(10**9+7)
print(c%(10**9+7))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=[int(input()) for _ in range(m)]
if m>1:
    for i in range(m-1):
        if a[i+1]-a[i]==1:
            print(0)
            exit()
def fb(num):
    a,b = 1,0
    for _ in range(num+1):
        a,b = a+b,a
    return b
c=0
for i in range(m):
    if i==0 and a[0]==1:
        c+=1
    elif i==0:
        c+=fb(a[0]-1)
    else:
        c*=(fb(a[i]-a[i-1]-2)%(10**9+7))
c*=fb(n-a[-1]-1)%(10**9+7)
print(c%(10**9+7))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=[int(input()) for _ in range(m)]
if m>1:
    for i in range(m-1):
        if a[i+1]-a[i]==1:
            print(0)
            exit()
def fb(num):
    a,b = 1,0
    for _ in range(num+1):
        a,b = a+b,a
    return b
c=0
for i in range(m):
    if i==0 and a[0]==1:
        c+=1
    elif i==0:
        c+=fb(a[0]-1)
    else:
        c*=(fb(a[i]-a[i-1]-2)%(10**9+7))
    print(c)
c*=fb(n-a[-1]-1)%(10**9+7)
print(c%(10**9+7))
Problem p03038 (python)

Fixed submission:
n,m=map(int,input().split())
a=list(map(int,input().split()))
l=[list(map(int,input().split())) for _ in range(m)]
a.sort(reverse=True)
l.sort(key=lambda x:x[1],reverse=True)
o=sum(a)
for i in range(m):
    for j in range(1,l[i][0]+1):
        if len(a)==0:
            print(o)
            exit()
        if a[-1]>=l[i][1]:
            print(o)
            exit()
        else:
            r=a.pop(-1)
            o-=r
            o+=l[i][1]
print(o)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=list(map(int,input().split()))
l=[list(map(int,input().split())) for _ in range(m)]
a.sort(reverse=True)
l.sort(key=lambda x:x[1],reverse=True)
o=sum(a)
for i in range(m):
    for j in range(1,l[i][0]+1):
        if a[-1]>=l[i][1]:
            print(o)
            exit()
        else:
            r=a.pop(-1)
            o-=r
            o+=l[i][1]
print(o)
Problem p03075 (python)

Fixed submission:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
if e-a>k:print(':(')
else:print('Yay!')

Buggy submission (verdict: Runtime Error):
a,b,c,d,e,k= map(int,input().split())
if e-a>k:print(':(')
else:print('Yay!')
Problem p03077 (python)

Fixed submission:
n=int(input())
t=[int(input()) for _ in range(5)]
k=(n-1)//min(t)
print(k+5)

Buggy submission (verdict: Runtime Error):
n=int(input())
t=[int(input()) for _ in range(4)]
if n//min(t)<1:
    n//min(t)=1
print(n//min(t) +4)

Buggy submission (verdict: Runtime Error):
n=int(input())
t=[int(input()) for _ in range(5)]
if n//min(t)<1:
    n//min(t)=1
print(n//min(t) +4)

Buggy submission (verdict: Runtime Error):
n=int(input())
t=[int(input()) for _ in range(n)]
if n//min(t)<1:
    n//min(t)=1
print(n//min(t) +4)
Problem p03127 (python)

Fixed submission:
import fractions
from functools import reduce
n=int(input())
a=list(map(int,input().split()))
print(reduce(fractions.gcd,a))

Buggy submission (verdict: Runtime Error):
import fractions
from functools import reduce
n=int(input())
a=list(map(int,input().split()))
def gcd(*numbers):
    return reduce(gcd, numbers)
def gcd_list(numbers):
    return reduce(gcd, numbers)
print(gcd_list(a))

Buggy submission (verdict: Runtime Error):
import math
from fractions import gcd
from functools import reduce
n=int(input())
a=list(map(int,input().split()))
def gcd(*numbers):
    return reduce(math.gcd, numbers)
def gcd_list(numbers):
    return reduce(math.gcd, numbers)
print(gcd_list(a))

Buggy submission (verdict: Runtime Error):
from fractions import gcd
from functools import reduce
n=int(input())
a=list(map(int,input().split()))
def gcd(*numbers):
    return reduce(gcd, numbers)
def gcd_list(numbers):
    return reduce(gcd, numbers)
print(gcd_list(a))

Buggy submission (verdict: Runtime Error):
from fractions import gcd
from functools import reduce
n=int(input())
a=list(map(int,input().split()))
def gcd(*numbers):
    return reduce(math.gcd, numbers)
def gcd_list(numbers):
    return reduce(math.gcd, numbers)
print(gcd_list(a))
Problem p03221 (python)

Fixed submission:
n,m=map(int,input().split())
py=[list(map(int,input().split())) for _ in range(m)]
l=[1]*n
for i in range(m):
    py[i].append(i+1)
py.sort()
for i in range(m):
    py[i].append( str(py[i][0]).zfill(6) + str(l[py[i][0]-1]).zfill(6))
    l[py[i][0]-1]+=1
py.sort(key=lambda x:x[2])
for i in range(m):
    print(py[i][-1])

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
py=[list(map(int,input().split()))]
l=[1]*n
for i in range(m):
    py[i].append(i+1)
py.sort()
for i in range(m):
    py[i].append( str(py[i][0]).zfill(6) + str(l[py[i][0]-1]).zfill(6))
    l[py[i][0]-1]+=1
py.sort(key=lambda x:x[2])
for i in range(m):
    print(py[i][-1])
Problem p03250 (python)

Fixed submission:
k=list(map(str,input().split()))
k.sort()
l=str(k[2])+str(k[1])
print(int(l)+int(k[0]))

Buggy submission (verdict: Runtime Error):
k=list(map(str,input().split()))
print(int(max(k)+max(k)[1])+int(min(k)))
Problem p03295 (python)

Fixed submission:
n,m=map(int,input().split())
l=[list(map(int,input().split())) for i in range(m)]
l.sort(key=lambda x:x[1])
lb=0
c=0
for a,b in l:
    if a>=lb:
        lb=b
        c+=1
print(c)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
ab=[list(map(int,input().split())) for _ in range(m)]
l.sort(key=lambda x:x[1])
lb=0
ans=0
for a,b in l:
    if a>=lb:
        lb=b
        ans+=1
print(ans)
Problem p03327 (python)

Fixed submission:
n=int(input())
if n<=999:print('ABC')
else:print('ABD')

Buggy submission (verdict: Runtime Error):
n=int(input())
k=n-999
if n<=999:print('ABC'+str(n).fill(3))
else:print('ABD'+ str(k).zfill(3))

Buggy submission (verdict: Runtime Error):
n=int(input())
k=n-999
if n<=999:print('ABC'+str(n.fill(3)))
else:print('ABD'+ str(k.zfill(3)))
Problem p03775 (python)

Fixed submission:
import math
n=int(input())
k=int(math.sqrt(n))
l=[]
for i in range(1,k+2):
    if n%i==0:l.append(max( len(str(i)), len(str(n//i)) ))
print(min(l))

Buggy submission (verdict: Runtime Error):
import math
n=int(input())
k=int(math.sqrt(n))
l=[]
for i in range(1,k+2):
    if n%i==0:l.append(max(len(str(i),len(str(n//i))))
print(min(l))

Buggy submission (verdict: Runtime Error):
import math
n=int(input())
k=int(math.sqrt(n))
l=[]
for i in range(1,k+2):
    n%i==0:l.append(max(len(str(i),len(str(n//i))))
print(min(l))
Problem p03804 (python)

Fixed submission:
n,m = map(int,input().split()) #要復習
a = [input() for _ in range(n)]
b = [input() for _ in range(m)]
 
for i in range(n-m+1):
    for j in range(n-m+1):
        a1 = [a[k][j:j+m] for k in range(i,i+m)]
        if a1 == b:
            print('Yes')
            exit()

print('No')

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())#正方形
a= [list(input()) for _ in range(n)] #大
b= [list(input()) for _ in range(m)] #小
m1=0
for i in range(n-m+1): #行
    for j in range(n-m+1): #左からの位置
      if b[i][j+k]==a[i][j] for k in range(n-m+1):m1+=1
        if m1==m:print('Yes') and exit()
        else:pass
      else:print('No')

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())#正方形
a= [list(input()) for n in range(n)] #大
b= [list(input()) for m in range(m)] #小
m1=0
for i in range(n-m+1): #行
    for j in range(n-m+1): #左からの位置
      if b[i][j+k]==a[i][j] for k in range(n-m+1):m1+=1
        if m1==m:print('Yes') and exit()
        else:pass
      else:print('No')
Problem p03834 (python)

Fixed submission:
s1,s2,s3=list(map(str,input().split(',')))
print(s1 , s2 , s3)

Buggy submission (verdict: Runtime Error):
s1,s2,s3=list(map(str,input().split(,)))
print(s1 , s2 , s3)

Buggy submission (verdict: Runtime Error):
s1,s2,s3=list(map(str,input().split(,)))
print(s1 +''+ s2 +''+ s3)

Buggy submission (verdict: Runtime Error):
s1,s2,s3=list(map(str,input().split()))
print(s1[:5] +''+ s2[:7] +''+ s3[:5])
Problem p02831 (python)

Fixed submission:
import fractions
 
a, b = map(int, input().split())
print(a * b // fractions.gcd(a, b))

Buggy submission (verdict: Runtime Error):
import fractions

a, b = map(int, input().split())
print(a * b / gcd(a, b))
Problem p02859 (python)

Fixed submission:
r = int(input())

print(r ** 2)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
output = "No"

for i in range(1, n - 1):
    if n % i != 0:
        continue

    else:
        tmp = s[:i:]
        if tmp * (n // i) == s:
            output = "Yes"


print(output)
Problem p02933 (python)

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

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

Buggy submission (verdict: Runtime Error):
N = int(input())
v = list(map(int, input().split()))
i = 0

v.sort

for i in range(N - 1):
    v[i + 1] = (v[i] + v[i + 1]) / 2
    
print(v[-1])
Problem p02989 (python)

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

D.sort()

print(D[N // 2] - D[N // 2 - 1])

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

D.sort()

print(D[N / 2] - D[N / 2 - 1]
Problem p02777 (python)

Fixed submission:
from heapq import heappush,heappop
import queue
import re
import math
import functools


def i_raw():
    return int(input())

def ss_raw():
    return input().split()

def is_raw():
    return list(map(int, ss_raw()))

INF = 1<<29

def make1d_arr(n,val=INF):
    return [val for i in range(n)]

def make2d_arr(h,w,val =INF):
    return [[val for i in range(w)]for i in range(h)]

def gcd (a,b):
    if(b==0):
        return a
    return gcd(b,a%b)


def main():
    S,T = ss_raw()
    A,B = is_raw()
    U = input().strip()
    if U==S:
        return " ".join(map(str,[A-1,B]))
    else:
        return " ".join(map(str,[A,B-1]))  


print(main())

Buggy submission (verdict: Runtime Error):
from heapq import heappush,heappop
import queue
import re
import math
import functools
import numpy

def i_raw():
    return int(input())

def ss_raw():
    return input().split()

def is_raw():
    return list(map(int, ss_raw()))

INF = 1<<29

def make1d_arr(n,val=INF):
    return [val for i in range(n)]

def make2d_arr(h,w,val =INF):
    return [[val for i in range(w)]for i in range(h)]

def gcd (a,b):
    if(b==0):
        return a
    return gcd(b,a%b)


def main():
    S,T = ss_raw()
    A,B = is_raw()
    U = input().strip()
    if U==S:
        return " ".join(map(str,[A-1,B]))
    else:
        return " ".join(map(str,[A,B-1]))  


print(main())
Problem p02933 (python)

Fixed submission:
from heapq import heappush, heappop
import re
from collections import deque
import sys
import math
input = sys.stdin.readline


def int_raw():
    return int(input())

def str_in():
    return input().strip("\n")

def ss_raw():
    return input().split()


def ints_raw():
    return tuple(map(int, ss_raw()))


DIV = 10**9+7


def mod_inv_prime(a, mod=DIV):
    return pow(a, mod-2, mod)


def mod_inv(a, b):
    r = a
    w = b
    u = 1
    v = 0
    while w != 0:
        t = r//w
        r -= t*w
        r, w = w, r
        u -= t*v
        u, v = v, u
    return (u % b+b) % b


def ncr(n, r, mod=DIV):
	r = min(r, n-r)
	ret = 1
	for i in range(1, r+1):
		ret = ret * (n-i+1) % mod
		ret = ret * mod_inv(i, mod) % mod
	return ret


class UnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n+1)]
        self.rank = [0] * (n+1)
        self.mini = [i for i in range(n+1)]

    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if self.rank[x] < self.rank[y]:
            self.par[x] = y
        else:
            self.par[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1
        mini = min(self.mini[x],self.mini[y])
        self.mini[x]=mini
        self.mini[y]=mini
    
    def same_check(self, x, y):
        return self.find(x) == self.find(y)

def main():
    a = int_raw()
    s = input().strip("\n")
    return s if a >=3200 else "red"

    
print(main())

Buggy submission (verdict: Runtime Error):
from heapq import heappush, heappop
import queue
import re
import math
import functools
import numpy


def s_raw():
    return input().rstrip("\r")

def int_raw():
    return int(input())


def ss_raw():
    return input().split()


def ints_raw():
    return list(map(int, ss_raw()))


INF = 1 << 29


def make1d_arr(n, val=INF):
    return [val for i in range(n)]


def make2d_arr(h, w, val=INF):
    return [[val for i in range(w)]for i in range(h)]


def gcd(a, b):
    if(b == 0):
        return a
    return gcd(b, a % b)


def BFord(n,es):
    v_cost = [INF]*n
    v_cost[0] = 0
    for v in range(n*2):
        for e in es:
            frm = e[0]
            to = e[1]
            if v_cost[to] > v_cost[frm]+e[2]:
                v_cost[to] = v_cost[frm]+e[2]
                if v >= n:
                    v_cost[to] = -INF
        if v == n-1:
            prev = v_cost[:]
    v_cost = [-INF if prev[idx]!=v_cost[idx] else v_cost[idx] for idx in range(n)]
    return v_cost
    

def main():
    a = int_raw()
    s = s_raw()
    if a >=3200:
        return s
    else:
        return "red"

if __name__ == "__main__":
    print(main())
Problem p03033 (python)

Fixed submission:
import sys
input=sys.stdin.readline
from collections import deque
from heapq import heappush,heappop
import re

def int_raw():
    return int(input())
 
def ss_raw():
    return input().split()
 
def ints_raw():
    return tuple(map(int, ss_raw()))


def main():
    N ,Q = ints_raw()
    origST = []

    for idx  in range(N):
        S,T,X = ints_raw()
        origST.append([S-X,T-X,X])
    Ds = [int(input()) for _ in range(Q)]

    origST.sort()
    stidx = 0
    cur_set = []
    for q in Ds:

        while stidx < len(origST):
            st = origST[stidx]
            if st[0] > q:
                break
            heappush(cur_set,(st[2],st[1]))
            stidx+=1
        while cur_set and cur_set[0][1] <=q:
            heappop(cur_set)
        if len(cur_set)==0:
            print(-1)
        else:
            print(cur_set[0][0])
main()

Buggy submission (verdict: Runtime Error):
import sys
input=sys.stdin.readline
from collections import deque
from heapq import heappush,heappop
import re

def int_raw():
    return int(input())
 
def ss_raw():
    return input().split()
 
def ints_raw():
    return tuple(map(int, ss_raw()))


def main():
    N ,Q = ints_raw()
    origST = []

    for idx  in range(N):
        S,T,X = ints_raw()
        origST.append([S-X,T-X,X])
    Ds = [int(input()) for _ in range(Q)]

    origST.sort()
    stidx = 0
    cur_set = []
    for d in Ds:

        while stidx < len(origST):
            st = origST[stidx]
            if st[0] > d:
                break
            heappush(cur_set,(st[2],st[1]))
            stidx+=1
        while cur_set and cur_set[0][1] <=d:
            heappop(cur_set)
        if cur_set:
            print(-1)
        else:
            print(cur_set[0][0])
main()
Problem p03055 (python)

Fixed submission:
from collections import deque
from heapq import heappush,heappop
import re
def int_raw():
    return int(input())

def ss_raw():
    return input().split()

def ints_raw():
    return list(map(int, ss_raw()))

INF = 1<<29

def getDeci(tree):
    def saiki(v):
        root = [0,v,-1]
        cur = None
        qu = deque()
        qu.append(root)
        while len(qu)!=0:
            cur = qu.popleft()
            for e in tree[cur[1]]:
                if e ==cur[2]:
                    continue
                qu.append([cur[0]+1,e,cur[1]])
        return cur
    leaf = saiki(0)
    ans = saiki(leaf[1])
    return ans

    
N = int_raw()
tree = [[] for _ in range(N)]
for _ in range(N-1):
    a,b = ints_raw()
    a = a-1
    b = b-1
    tree[a].append(b)
    tree[b].append(a)



def main():
    ans = getDeci(tree)
    if (ans[0]+2)%3==0:
        return "Second"
    else:
        return "First"

print(main())

Buggy submission (verdict: Runtime Error):
from collections import deque
from heapq import heappush,heappop
import re
def int_raw():
    return int(input())

def ss_raw():
    return input().split()

def ints_raw():
    return list(map(int, ss_raw()))

INF = 1<<29

def getDeci(tree):
    def saiki(p,v):
        ans = [0,v]
        for e in tree[v]:
            if e ==p:
                continue
            tmp = saiki(v,e)
            tmp[0]=tmp[0]+1
            if ans[0]<tmp[0]:
                ans = tmp
        return ans
    leaf = saiki(-1,0)
    ans = saiki(-1,leaf[1])
    return ans

    
N = int_raw()
tree = [[] for _ in range(N)]
for _ in range(N-1):
    a,b = ints_raw()
    a = a-1
    b = b-1
    tree[a].append(b)
    tree[b].append(a)



def main():
    ans = getDeci(tree)
    if (ans[0]+2)%3==0:
        return "Second"
    else:
        return "First"

print(main())
Problem p02594 (python)

Fixed submission:
N = int(input())

if N >= 30:
    print("Yes")
else:
    print("No")

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

if X >= 30:
    print("Yes")
else:
    print("No")
Problem p02829 (python)

Fixed submission:
a = int(input())
b = int(input())
 
t = set([1, 2, 3])
s = set([a,b])
ans = t - s
print(list(ans)[0])

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())

t = set([1, 2, 3])
s = set([a,b])
ans = t - s
print(list(ans[0]))
Problem p02847 (python)

Fixed submission:
S = input()

d = {"SUN": 7, "MON":6, "TUE":5, "WED":4, "THU":3, "FRI":2, "SAT":1}
print(d[S])

Buggy submission (verdict: Runtime Error):
S = input()
d = {"SUN": 7, "MON":6, "TUE":5, "WED":4, "THR":3, "FRI":2, "SAT":1}
print(d[S])

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

d = {"SUN": 7, "MON":6, "TUE":5, "WED":4, "THR":3, "FRI":2, "SAT":1}
print(d[S])
Problem p02862 (python)

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

MD = pow(10, 9) + 7

def choose(n, a):
    x, y = 1, 1
    for i in range(a):
        x = x * (n - i) % MD
        y = y * (i + 1) % MD
    return x * pow(y, MD - 2, MD) % MD


a = (2*Y-X)//3
b = (Y-2*X)//-3

if a < 0 or b < 0 or (X+Y) % 3 != 0:
    print(0)
    import sys
    sys.exit()

print(choose(a+b, min(a,b)))

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

a = (4*Y-2*X)//6
b = (Y-2*X)//-3
if a == 0 and b == 0:
    print(0)
    import sys
    sys.exit()

from math import factorial
print(factorial(a+b)//factorial(a)*factorial(b)%(10e9+7))

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

# dp = [[0 for _ in range(X+1)] for __ in range(Y+1)]
# dp[1][2] = 1
# dp[2][1] = 1

# for xi in range(X + 1):
#     for yi in range(Y + 1):
#         dp[xi][yi] = dp[xi - 1][yi - 2] + dp[xi - 2][yi - 1]

# print(dp[X][Y])
import sys
sys.setrecursionlimit(100000)  # RecursionError対策

def help(x, y):
    if x < 0 or y < 0:
        return 0
    if (x == 1 and y == 2) or (x == 2 and y == 1):
        return 1
    else:
        return (help(x - 1, y - 2) + help(x - 2, y - 1))%(10e9+7)

print(help(X, Y))

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

sys.setrecursionlimit(10000)  # RecursionError対策

def help(x, y):
    if x < 0 or y < 0:
        return 0
    if (x == 1 and y == 2) or (x == 2 and y == 1):
        return 1
    else:
        return (help(x - 1, y - 2) + help(x - 2, y - 1))%(10e9+7)

print(help(X, Y))

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

# dp = [[0 for _ in range(X+1)] for __ in range(Y+1)]
# dp[1][2] = 1
# dp[2][1] = 1

# for xi in range(X + 1):
#     for yi in range(Y + 1):
#         dp[xi][yi] = dp[xi - 1][yi - 2] + dp[xi - 2][yi - 1]

# print(dp[X][Y])

def help(x, y):
    if x < 0 or y < 0:
        return 0
    if (x == 1 and y == 2) or (x == 2 and y == 1):
        return 1
    else:
        return (help(x - 1, y - 2) + help(x - 2, y - 1))%(10e9+7)

print(help(X, Y))
Problem p03986 (python)

Fixed submission:
X = input()

cache = 0
ans = len(X)

for c in X:
    if c == 'S':
        cache += 1
    else:
        if cache > 0:
            cache -= 1
            ans -= 2

print(ans)

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

cache = 0
ans = len(X)

for c in X:
    if c == 'S'
        cache += 1
    else:
        if cache > 0:
            cache -= 1
            ans -= 2

print(ans)
Problem p02595 (python)

Fixed submission:
import sys
from collections import deque
import numpy as np
import math
sys.setrecursionlimit(10**6)
def S(): return sys.stdin.readline().rstrip()
def SL(): return map(str,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())

if __name__=='__main__':
    n,d = IL()
    d = d*d
    c = 0
    for _ in range(n):
        x,y = IL()
        if x*x + y*y <= d:
            c += 1

    print(c)
    exit()

Buggy submission (verdict: Runtime Error):
import sys
from collections import deque
import numpy as np
import math
sys.setrecursionlimit(10**6)
def S(): return sys.stdin.readline().rstrip()
def SL(): return map(str,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())

if __name__=='__main__':
    n,d = IL()
    d = d*d
    c = 0
    for _ in range(n):
        x,y = IL()
        if x*x + y*y <= d:
            c += 1

    print(c)
    exit()
Problem p02659 (python)

Fixed submission:
from decimal import Decimal
from sys import stdin
def LD(): return list(map(Decimal,stdin.readline().rstrip().split()))
 
tmp = LD()
ans = int(tmp[0]*tmp[1])
print(ans)

Buggy submission (verdict: Runtime Error):
from decimal import Decimal
from sys import stdin
def LD(): return list(map(Decimal,stdin.readline().rstrip().split()))
 
tmp = LD()
ans = int(a*b)
print(ans)

Buggy submission (verdict: Runtime Error):
from sys import stdin
from math
def LF(): return list(map(float,stdin.readline().rstrip().split()))

tmp = LF()
ans = tmp[0]*tmp[1]
print(math.floor(ans))