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

Fixed submission:
import sys

n,m = map(int, input().split())
a = [0]
for i in range(m):
    a.append(int(input()))
a.append(n)
    
mod = 1000000007
ans = 1

for i in range(1,len(a)-2):
    if a[i+1]-a[i]==1:
        print(0)
        sys,exit()

b = []
for i in range(1,len(a)):
    if i == 1:
        b.append(a[1]-1-a[0])
    elif i == len(a)-1:
        b.append(a[i]-(a[i-1]+1))
    else:
        b.append(a[i]-1-(a[i-1]+1))

dp = []
for i in range(10**6):
    if i == 0:
        dp.append(1)
        continue
    if i == 1:
        dp.append(1)
        continue
    if i == 2:
        dp.append(2)
        continue
    dp.append((dp[i-1]+dp[i-2])%mod)

if m == 0:
  print(dp[n])
  sys.exit()
    
for i in range(len(b)):
    l = b[i]
    ans = (ans*dp[l])%mod
    
print(ans)

Buggy submission (verdict: Runtime Error):
import sys

n,m = map(int, input().split())
a = [0]
for i in range(m):
    a.append(int(input()))
a.append(n)
    
mod = 1000000007
ans = 1

for i in range(1,len(a)-2):
    if a[i+1]-a[i]==1:
        print(0)
        sys,exit()

b = []
for i in range(1,len(a)):
    if i == 1:
        b.appned(a[1]-1-a[0])
    elif i == len(a)-1:
        b.append(a[i]-(a[i-1]+1))
    else:
        b.append(a[i]-1-(a[i-1]+1))

dp = []
for i in range(10**6):
    if i == 0:
        dp.append(1)
        continue
    if i == 1:
        dp.append(1)
        continue
    if i == 2:
        dp.append(2)
        continue
    dp.append((dp[i-1]+dp[i-2])%mod)

for i in range(len(b)):
    l = b[i]
    ans = (ans*dp[l])%mod
    
print(b)
Problem p03805 (python)

Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np

n,m = map(int, input().split())
graph = [[0 for i in range(n)] for j in range(n)]
graph = np.array(graph)

for i in range(m):
    a,b = map(int, input().split())
    graph[a-1,b-1] = 1
    graph[b-1,a-1] = 1

used = [False]*n
used[0] = True

def DFS(v,used):
    global ans
    if all(used):
        ans += 1
        return 
    for i in range(n):
        if used[i]:
            continue
        if graph[i,v] == 0:
            continue
        used[i] = True
        DFS(i,used)
        used[i] = False
    return

ans = 0
DFS(0,used)

print(ans)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import numpy as np

n,m = map(int, input().split())
graph = [[] for j in range(n)]
graph = np.array(graph)

for i in range(m):
    a,b = map(int, input().split())
    graph[a-1].append(b-1)
    graph[b-1].append(a-1)

used = [False]*n
used[0] = True

def DFS(v,used):
    if all(used):
        return 1
    ans = 0
    for i in graph(v):
        if used[i]:
            continue
        used[i] = True
        ans += DFS(i,used)
        used[i] = False
    return ans
  
print(DFS(0,used))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import numpy as np

n,m = map(int, input().split())
graph = [[0 for i in range(n)] for j in range(n)]
graph = np.array(graph)

for i in range(m):
    a,b = map(int, input().split())
    graph[a-1].append(b-1)
    graph[b-1].append(a-1)

used = [False]*n
used[0] = True

def DFS(v,used):
    if all(used):
        return 1
    ans = 0
    for i in graph(v):
        if used[i]:
            continue
        used[i] = True
        ans += DFS(i,used)
        used[i] = False
    return ans
  
print(DFS(0,used))
Problem p02707 (python)

Fixed submission:
import collections


def resolve():
    n = int(input())
    woker = list(map(int, input().split()))
    woker_count = collections.Counter(woker)
    for i in range(n):
        print(woker_count[i + 1])


resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    n = int(input())
    woker = list(map(int, input().split()))
    woker_count = collections.Counter(woker)
    for i in range(n):
        print(woker_count[i + 1])


resolve()
Problem p02860 (python)

Fixed submission:
def main():
    n = int(input())
    s = input()

    if n % 2 == 1:
        print("No")
        return

    if s[:len(s)//2] == s[len(s)//2:]:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

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

    if n % 2 == 1:
        print("No")
        return

    if s[:len(s)/2] == s[len(s)/2:]:
        print("Yes")
    else:
        print("No")


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

Fixed submission:
import math

N,M = map(int,input().split())



def combinations_count(n, r):
    if n <= 1:
        return 0
    else:
        return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

n = combinations_count(N, 2)
m = combinations_count(M, 2)

print(n+m)

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
M = int(input())


def combinations_count(n, r):
    if n <= 1:
        return 0
    else:
        return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

n = combinations_count(N, 2)
m = combinations_count(M, 2)

print(n+m)
Problem p02831 (python)

Fixed submission:
import fractions

A, B = map(int,input().split())

def lcm(A, B):
    return (A * B) // fractions.gcd(A, B)

print(lcm(A, B))

Buggy submission (verdict: Runtime Error):
import math

A, B = map(int,input().split())

def lcm(A, B):
    return (A * B) // math.gcd(A, B)

print(lcm(A, B))
Problem p02879 (python)

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

if A >= 10 or B >= 10:
    print(-1)
else:
    print(A*B)

Buggy submission (verdict: Runtime Error):
N = int(input())
M = [x*y for y in range(1,10) for x in range(1,10)]

if N in M:
    print('Yes')     
else:
    print('No')
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())
a = list(map(int,input().split()))
 
a.sort()
for i in range(n-1):
    a[i+1] = (a[i] + a[i+1]) / 2
 
print(a[-1])
Problem p02959 (python)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
ans = 0
 
for i in range(N):
    k = B[i] - A[i]
    if k > 0:
        ans += A[i]
        A[i] = 0 
        if A[i+1] < k:
            ans += A[i+1]
            A[i+1] = 0
        else:
            ans += k
            A[i+1] -= k
    else:
        ans += B[i]
        A[i] =- k

print(ans)

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

ans = 0 
for i in range(N): 
    d = min(A[i], B[i]) 
    ans += d 
    A[i] -= d 
    B[i] -= d 
    d = min(A[i + 1], B[i]) 
    ans += d A[i + 1] -= d 
    B[i] -= d print(ans)
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input()) A = list(map(int,input().split())) B = list(map(int,input().split())) ans = 0
for i in range(N): d = min(A[i], B[i])
ans += d
A[i] -= d
B[i] -= d
d = min(A[i + 1], B[i])
ans += d
A[i + 1] -= d
B[i] -= d

print(ans)
Problem p02987 (python)

Fixed submission:
A=list(map(str,input()))

if A[0]==A[1] and A[0]==A[2] and A[0]==A[3]:
    print("No")
elif A[0]==A[1] and A[2]==A[3]:
    print("Yes")
elif A[0]==A[2] and A[1]==A[3]:
    print("Yes")
elif A[0]==A[3] and A[1]==A[2]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
A=list(input().split())

if A[0]==A[1] and A[2]==A[3]:
    print("Yes")
elif A[0]==A[2] and A[1]==A[3]:
    print("Yes")
elif A[0]==A[3] and A[1]==A[2]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
A=list(map(int,input()))

if A[0]==A[1] and A[2]==A[3]:
    print("Yes")
elif A[0]==A[2] and A[1]==A[3]:
    print("Yes")
elif A[0]==A[3] and A[1]==A[2]:
    print("Yes")
else:
    print("No")
Problem p03011 (python)

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


newlist = sorted(A)

sum = newlist[0] + newlist[1]

print(sum)

Buggy submission (verdict: Runtime Error):
N = int(input())
W = map(int, input().split())
s1, s2 = 0, sum(W)
ans = sum(W)
for i in range(N):
	s1 += W[i]
	s2 -= W[i]
	ans = min(ans, abs(s1 - s2))
print(ans)

Buggy submission (verdict: Runtime Error):
P = int(input())
Q = int(input())
R = int(input())

list = []

list = P,Q,R
newlist = sorted(list)

a = newlist[0] + newlist[1]
print(a)
Problem p02990 (python)

Fixed submission:
import sys
input = sys.stdin.readline

def main():
    N, K = map(int, input().split())

    MOD = int(1e9) + 7

    val = N-K+1

    kai = [1] * (max(val+1, K))
    for i in range(2, len(kai)):
        kai[i] = kai[i-1] * i
        kai[i] %= MOD

    for i in range(1, K+1):
        if val-i < 0:
            print(0)
            continue
        tmp = kai[val] * pow(kai[val-i], MOD-2, MOD) * pow(kai[i], MOD-2, MOD)
        tmp %= MOD
        # print(K-1, K-i, i-1)
        tmp *= kai[K-1] * pow(kai[K-i], MOD-2, MOD) * pow(kai[i-1], MOD-2, MOD)
        tmp %= MOD
        print(tmp)

if __name__ == "__main__":
    main()

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

def main():
    N, K = map(int, input().split())

    MOD = int(1e9) + 7

    val = N-K+1

    kai = [1] * (val+1)
    for i in range(2, len(kai)):
        kai[i] = kai[i-1] * i
        kai[i] %= MOD

    for i in range(1, K+1):
        tmp = kai[val] * pow(kai[val-i], MOD-2, MOD) * pow(kai[i], MOD-2, MOD)
        tmp %= MOD
        tmp *= pow(i, K-i, MOD)
        tmp %= MOD
        print(tmp)

if __name__ == "__main__":
    main()
Problem p03617 (python)

Fixed submission:
q,h,re,d = map(int,input().split())
n = int(input())
re = min(q*4, h*2,re)
print(min(re*n, n//2*d + (n%2)*re))

Buggy submission (verdict: Runtime Error):
q,h,re,d = map(int,input().split())
n = int(input())
re = min(q*4, h*2,result)
print(min(result*n, n//2*d + (n%2)*re))
Problem p04005 (python)

Fixed submission:
import sys
input = sys.stdin.readline
 
def linput(ty=int, cvt=list):
	return cvt(map(ty,input().split()))
 
def gcd(a: int, b: int):
	while b: a, b = b, a%b
	return a
 
def lcm(a: int, b: int):
	return a * b // gcd(a, b)
 
def main():
	#n=int(input())
	#vA=linput()
	a,b,c = linput()
	
	res = 0
	
	x = (a%2)*b*c
	y = (b%2)*c*a
	z = (c%2)*a*b
	
	res = min(x,y,z)
	
	#sT = "No Yes".split()
	#print(sT[res])
	print(res)
 
if __name__ == "__main__":
	main()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
 
def linput(ty=int, cvt=list):
	return cvt(map(ty,input().split()))
 
def gcd(a: int, b: int):
	while b: a, b = b, a%b
	return a
 
def lcm(a: int, b: int):
	return a * b // gcd(a, b)
 
def main():
	#n=int(input())
Problem p03631 (python)

Fixed submission:
N = input()

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

Buggy submission (verdict: Runtime Error):
def solve():
    A, B, C, D = list(map(int, input().split()))
    ans = min(B,D) - max(A,C)
    if ans < 0:
        ans = 0
    print(ans)
    
solve()

Buggy submission (verdict: Runtime Error):
# coding: utf-8
# Here your code !
N = int(input())
A = int(input())

print(N*N-A)
Problem p03774 (python)

Fixed submission:
N, M = list(map(int, input().split()))
ab = [list(map(int, input().split())) for i in range(N)]
cd = [list(map(int, input().split())) for i in range(M)]
for ab_i in ab:
    min_j = -1
    min_manh = float('inf')
    for j, cd_j in enumerate(cd):
        if min_manh > abs(ab_i[0]-cd_j[0])+abs(ab_i[1]-cd_j[1]):
            min_manh = abs(ab_i[0]-cd_j[0])+abs(ab_i[1]-cd_j[1])
            min_j = j+1
    print(min_j)

Buggy submission (verdict: Runtime Error):
N, M = list(map(int, input().split()))
ab = [list(map(int, input().split())) for i in range(N)]
cd = [list(map(int, input().split())) for i in range(N)]
for ab_i in ab:
    min_j = -1
    min_manh = float('inf')
    for j, cd_j in enumerate(cd):
        if min_manh > abs(ab_i[0]-cd_j[0])+abs(ab_i[1]-cd_j[1]):
            min_manh = abs(ab_i[0]-cd_j[0])+abs(ab_i[1]-cd_j[1])
            min_j = j+1
    print(min_j)
Problem p02682 (python)

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

S = A+B+C
result = 0

if ( K > (A+B) ):
    result = A*(1) + (K-(A+B))*(-1)
elif ( (A+B) >= K >= A):
    result = A*(1)
elif ( A > K ):
    result = K*(1)

print(result)

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

S = A+B+C
result = 0

if ( K > (A+B) ):
    result = A*(1) + (K-(A+B))*(-1)
else ( (A+B) >= K ):
    result = A*(1)

print(result)
Problem p03127 (python)

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

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce
N = int(input())
A = list(map(int, input().split()))
gcd = reduce(math.gcd, A)
print(gcd)

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

lcm = sympy.gcd(A)
print(lcm)
Problem p03013 (python)

Fixed submission:
import sys
from fractions import gcd
from functools import reduce
from itertools import combinations

import numpy as np

sys.setrecursionlimit(200000)


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


def ii(t: type = int):
    return t(input())


def il(t: type = int):
    return list(map(t, input().split()))


def imi(N: int, t: type = int):
    return [ii(t) for _ in range(N)]


def iml(N: int, t: type = int):
    return [il(t) for _ in range(N)]


def solve():
    mod = 1000000007
    N, M = il()
    a = [True] * (N+1)
    for b in imi(M):
        a[b] = False
    dp = [0] * (N + 1)
    dp[0] = 1
    for now in range(N):
        for next in range(now + 1, min(N, now + 2)+1):
            if a[next]:
                dp[next] += dp[now]
                dp[next] %= mod
    return dp[N]


if __name__ == "__main__":
    print(solve())

Buggy submission (verdict: Runtime Error):
import sys
from fractions import gcd
from functools import reduce
from itertools import combinations

import numpy as np

sys.setrecursionlimit(200000)


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


def ii(t: type = int):
    return t(input())


def il(t: type = int):
    return list(map(t, input().split()))


def imi(N: int, t: type = int):
    return [ii(t) for _ in range(N)]


def iml(N: int, t: type = int):
    return [il(t) for _ in range(N)]


def solve():
    mod = 100_000_000_7
    N, M = il()
    a = [True] * (N+1)
    for b in imi(M):
        a[b] = False
    dp = [0] * (N + 1)
    dp[0] = 1
    for now in range(N):
        for next in range(now + 1, min(N, now + 2)+1):
            if a[next]:
                dp[next] += dp[now]
                dp[next] %= mod
    return dp[N]


if __name__ == "__main__":
    print(solve())
Problem p02897 (python)

Fixed submission:
n = int(input())

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

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

def main():
    #入力
    [n, k] = [int(i) for i in input().split()] 
    h = [int(i) for i in input().split()] 

    print(len(able_ride_jet(k, h)))


def able_ride_jet(const, heights):
    """ ジェットコースターに乗れる人の身長のリストを返す関数
    """
    return list(filter(lambda x: x >= const, heights))


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

Fixed submission:
T, X=[int(i) for i in input().split()]
print(T/X)

Buggy submission (verdict: Runtime Error):
import sys

T = int(sys.argv[1])
X = int(sys.argv[2])

print(T/X)
Problem p02785 (python)

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

H.sort(reverse=True)

if K >= N:
    print(0)
else:
    print(sum(H[K:]))

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

H.sort(reverse=True)

if K >= N:
    print(0)
else:
    print(sum(H[K:]))

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

H.sorted(reverse=True)

if K >= N:
    print(0)
else:
    print(sum(H[K:]))

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

H.sorted(reverse=True)

if K >= N:
    print(0)
else:
    for i in range(K):
        print(sum(H[K:]))

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

H.sorted(reverse=True)
ans=0

if K >= N:
    print(ans)
else:
    for i in range(K):
        ans += 1

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

H.sort(reverse=True)

if K >= N:
    print(0)
else:
    for i in range(K):
        del H[i]
    print(sum(H))

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

H.sort(reverse=True)

if K >= N:
    print(0)
else:
    for i in range(K):
        del H[i]
    print(sum(H))

Buggy submission (verdict: Runtime Error):
import heapq

def heapsort(iterable):
    h = []
    for value in iterable:
        heapq.heappush(h, value)
    return [heapq.heappop(h) for i in range(len(h))]

N, K = map(int, input().split(" "))
H = list(map(int, input().split(" ")))

heapsort(H)
# heapq.heapify(H)
# H.sort(reverse=True)

if K >= N:
    print(0)
else:
    for i in range(K):
        del H[i]
    print(sum(H))

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

H.sort(reverse=True)

if K >= N:
    print(0)
else:
    for i in range(K):
        del H[i]
    print(sum(H))
Problem p02831 (python)

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

def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y)

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))

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 p02833 (python)

Fixed submission:
N = int(input())

hoge = []

if N % 2 != 0:
    print(0)
else:
    for i in range(1, 40):
        hoge.append((N // 10)  // (5 ** i))
    print(sum(hoge) + (N // 10))

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

hoge = []

if N % 2 != 0:
    purint(0)
else:
    for i in range(1, 19):
        hoge.append(N // 10**i)
    print(sum(hoge))
Problem p02711 (python)

Fixed submission:
a=int(input())
while(a>0):
  k=a%10
  if k==7:
    print("Yes")
    exit()
  a//=10
print("No")

Buggy submission (verdict: Runtime Error):
from math import ceil
n=int(input())
s=input()
r=0
g=0
b=0
for i in range (len(s)):
  if s[i]=='R':
    r+=1
  elif s[i]=='B':
    b+=1
  else:
    g+=1
c=0
for i in range(1,n//2,1):
  for j in range(0,n-2*i,1):
    if s[j+0*i]!=s[j+1*i] and s[j+1*i]!=s[j+2*i] and s[j+2*i]!=s[j+0*i]:
      c+=1;
      
      
ans=r*g*b-c;
print(ans)
Problem p03075 (python)

Fixed submission:
A=[int(input()) for i in range(5)]
K = int(input())

if(A[-1] - A[0] <= K):
  print("Yay!")
else:
  print(":(")

Buggy submission (verdict: Runtime Error):
A=[int(input()) for i in range(5)]
K = int(input())

if(A[-1] - A[0] <= K):
  print("Yay!")
 else:
  print(":(")
Problem p03041 (python)

Fixed submission:
import functools
def a(c0, c1):
   return c0+c1

n,k = list(map(int, input().split()))
s = list(str(input()))

s[k-1] = s[k-1].lower()
d = functools.reduce(a, s)

print(d)

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

s[k-1] = s[k-1].lower()
print(s)
Problem p02701 (python)

Fixed submission:
n=int(input())
a=[0]*n
for i in range(n):
  a[i]=input()
  
a=set(a)
print(len(a))

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
a=set(a)
print(len(a))
Problem p02725 (python)

Fixed submission:
k,n=map(int,input().split())
A=list(map(int,input().split()))
d=[0]*n
d[0]=A[n-1]-A[0]
for i in range(1,n):
  d[i]=k-A[i] + A[i-1]
    
print(min(d))

Buggy submission (verdict: Runtime Error):
k,n=map(int,input().split())
A=list(map(int,input().split()))
d=[0]*len(A)
for i in range(len(A)):
  if i==0:
    d[i]=A[len(A)]-A[i]
  else:
    d[i]=k-A[i] + A[i-1]
    
print(min(A))
Problem p02753 (python)

Fixed submission:
s=str(input())
if s[0] == s[1] and s[1] == s[2] and s[0] == s[2]:
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
s=int(input())
if s[0] == s[1] and s[1] == s[2] and s[0] == s[2]:
  print('No')
else:
  print('Yes')
Problem p02785 (python)

Fixed submission:
n,k=map(int,input().split())
h=list(map(int,input().split()))
h.sort()
h=h[::-1]

if k>=n:
  print(0)
  
elif k!=0:
  for i in range(k):
    h[i]=0
  print(sum(h))

else:
  print(sum(h))

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
h=list(map(int,input().split()))
h.sort()
h=h[::-1]
if k!=0:
  for i in range(k):
    h[i]=0

  
print(sum(h))

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
h=list(map(int,input().split()))
h.sort()
h=[::-1]
if k!=0:
  for i in range(k):
    h[i]=0

  
print(sum(h))
Problem p02831 (python)

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

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
import math
c=a*b//math.gcd(a,b)
print(c)
Problem p02880 (python)

Fixed submission:
n=int(input())
t=False

for i in range(1,10):
  for j in range(1,10):
    if i*j==n:
      t=True
      break
if t:
  print('Yes')
else:
  print('No')

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

for i in range(1,10):
  for j in range(1,10):
    if i*j==n:
      t=True
      break
if t:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
n=input(n)
t=False

for i in range(1,10):
  for j in range(1,10):
    if i*j==n:
      t=True
      break
if t:
  print('Yes')
else:
  print('No')
Problem p03013 (python)

Fixed submission:
N,M = map(int,input().split())
a = set(int(input()) for x in range(M))
A = [0]*(N+1)
mod = 1000000007
A[0] = 1
if not(1 in a):
  A[1] = 1
for i in range(2,N+1):
    if i in a:
      A[i] = 0
    else:
      A[i] = (A[i-2] + A[i-1]) % mod
print(A[N])

Buggy submission (verdict: Runtime Error):
n,m=mp(int,input().split())
a=[int(input()) for i in range(m)]
mod=10**9+7

dp=[0]*(n+1)
dp[0]=1

if 1 not in a:
  dp[1]=1
else:
  dp[1]=0
  

for i in range(2,n+1):
  if i in a:
    continue
  dp[i]=dp[i-1]+dp[i-2]
  dp[i]%=mod
  
print(dp[n])
Problem p03835 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10 ** 5)

# sys.stdin = open('input.txt', 'r')
# sys.stdout = open('output.txt', 'w') 

readline =sys.stdin.readline

# time - O(n2)
def process():
    k,s = map(int,readline().rstrip().split())
    cnt=0

    for i in range(0,k+1):
        for j in range(0,k+1):
            z = s-(i+j)
            if z>=0 and z<=k:
                cnt+=1
    
    return cnt



# for _ in range(int(readline().rstrip())):
print(process())

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10 ** 5)

# sys.stdin = open('input.txt', 'r')
# sys.stdout = open('output.txt', 'w') 

# readline =sys.stdin.readline

# time - O(n2)
def process():
    k,s = map(int,readline().rstrip().split())
    cnt=0

    for i in range(0,k+1):
        for j in range(0,k+1):
            z = s-(i+j)
            if z>=0 and z<=k:
                cnt+=1
    
    return cnt



# for _ in range(int(readline().rstrip())):
print(process())