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

Fixed submission:
import sys
sys.setrecursionlimit(300000)
from fractions import gcd
from collections import defaultdict

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7
INF = float('inf')


N = I()
d = defaultdict(int)
zero = 0
for i in range(N):
    a, b = MI()
    if a == 0 and b == 0:
        zero += 1
        continue
    g = gcd(a, b)
    a, b = a // g, b // g
    minus = (-1) ** ((a < 0) + (b < 0))
    d[(minus * abs(a), abs(b))] += 1

ans = 1
seen = set()
for a, b in d:
    if (a, b) not in seen:
        if (a, b) in [(1, 0), (0, 1)]:
            ainv, binv = b, a
        else:
            ainv, binv = b * (1 if a < 0 else -1), abs(a)
        lans = (2 ** d[(a, b)] - 1)
        lans += (2 ** d[(ainv, binv)] - 1) if d.get((ainv, binv)) is not None else 0
        lans += 1
        ans = ans * lans % MOD
        seen.add((a, b))
        seen.add((ainv, binv))
ans = (ans + zero) % MOD
print((ans + MOD - 1) % MOD)

Buggy submission (verdict: Runtime Error):
import math
from collections import defaultdict

def INP(): return int(input())
def LINP(): return list(map(int,input().split()))

MOD = 10 * 9 + 7
d = defaultdict(int)
zero = 0
N = INP()
print(N)
for _ in range(N):
    A,B = LINP()
    if A == 0 and B == 0:
        zero += 1
        continue
    A = int(A/math.gcd(A,B))
    B = int(B/math.gcd(A,B))
    minus = (-1) ** ((A < 0) + (B < 0))
    d[(minus * abs(A), abs(B))] += 1

ans = 1
seen = set()
for a, b in d:
    if (a, b) not in seen:
        if(a, b) in [(0, 1), (1, 0)]:
            ainv, binv = b, a
        else:
            ainv, binv = b * (1 if a < 0 else -1), abs(a)
        new_ans = (2 ** d[(a, b)] - 1)
        new_ans *= (2 ** d[(ainv, binv)] -1) if d.get(ainv, binv) != None else 0
        new_ans += 1
        ans *= new_ans % MOD
        seen.add((a, b))
        seen.add((ainv, binv))
ans = (ans + zero) & MOD
print(ans)

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
mod = 1000000007
dic = {} #{[2,3]:[正の数,負の数]}
zero = 0
dic[0,1] = [0,0]

#辞書登録
for i in range(N):
    A,B = list(map(int,input().split()))

    if(A == 0 and B == 0):
        zero += 1
        continue
    elif(A == 0 and B != 0):
        dic[[0,1]][0] += 1
        continue
    elif(A != 0 and B == 0):
        dic[[0,1]][1] += 1
        continue

    if(A*B < 0):
        A = (-1) * abs(A)
    else:
        A = abs(A)
    B = abs(B)
    As /= gcd(A,B)
    Bs /= gcd(A,B)
    if(A*B < 0):
        if([B,abs(A)] in dic):
            dic[[B,abs(A)]][1] += 1
        else:
            dic[[B,abs(A)]] = [0,1]
    else:
        if([A,B] in dic):
            dic[[A,B]][0] += 1
        else:
            dic[[A,B]] = [1,0]

cnt_iso = 0
ans = 1

#ペアになってない数
for key in dic.key:
    if(key[0] == 0):
        cnt_iso += key[1]
    elif(key[1] == 0):
        cnt_iso += key[1]

ans *= 2**cnt_iso % mod

for key in dic.key:
    if(key[0] != 0 and key[1] != 0):
        ans *= (2**key[0] + 2**key[1]) % mod

print(ans)
Problem p02688 (python)

Fixed submission:
n,k=map(int,input().split())
ans=[None]*n
while k>0:
  d=input()
  a=list(map(int,input().split()))
  #print (d,a)
  for i in a:
    ans[i-1]=d
  k-=1
count=0
for item in ans:
  if item==None:
    count+=1
print (count)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
ans=[None]*n
while k>0:
  d=input()
  a=list(map(int,input().split()))
  #print (d,a)
  for i in a:
    ans[i-1]=d
  k-=1
count=0
for item in ans:
  if item==None:
    count+=1
print (count)a
Problem p02773 (python)

Fixed submission:
from collections import defaultdict

H=int(input())
d = defaultdict(int)
for _ in range(H):
    d[input()] += 1
max_appeard=max(d.items(), key=lambda x: x[1])[1]
ans=[k for k,v in d.items() if v == max_appeard]
ans.sort()
for item in ans:
  print (item)

Buggy submission (verdict: Runtime Error):
input_line=int(input())
count=0
input_list=[]
while count < input_line:
  input_list.append(input())
  count+=1
ans={}
max_appeard=0
ans_list=[]
list_set=set[ans_list]
for item in list_set:
    appeard=input_list.count(item)
    ans[item]=appeard
    if appeard > max_appeard:
        max_appeard=appeard
for key,value in ans.items():
    if value==max_appeard:
        ans_list.append(key)
ans_list.sort()
for item in ans_list:
  print (item)
Problem p02552 (python)

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

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

Buggy submission (verdict: Runtime Error):
while True:
  	try:
		x = input()
		if x == 1:
  			print(0)
   			break
        elif x ==0:
            print(1)
            break
        else:
            continue
	except:
      	print('invalid input')
        continue

Buggy submission (verdict: Runtime Error):
while True:
	x = input()
	if x == 1:
  		print(0)
   		break
	elif x ==0:
  		print(1)
        break
    else:
      continue
Problem p03209 (python)

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

counts = [0] * (N+1)
counts[0] = 1
for i in range(1, N+1):
    counts[i] = 2 * counts[i-1] + 3


def req(n, x):
    if n == 0:
        return 1

    if x == 1:
        return 0
    elif x > 1 and x <= counts[n-1] + 1:
        return req(n - 1, x - 1)
    elif x == counts[n-1] + 2:
        return req(n - 1, counts[n-1]) + 1
    else:
        if x == 2*counts[n-1] + 3:
            return req(n-1, counts[n-1]) * 2 + 1
        else:
            return req(n-1, x - (counts[n-1] + 2)) + req(n - 1, counts[n-1]) + 1


print(req(N, X))

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

counts = [0] * (N+1)
counts[0] = 1
for i in range(1, N+1):
    counts[i] = 2 * counts[i-1] + 3

def req(n, x):
    if n == 0 and x == 1:
        return 1

    if x == 1:
        return 0
    elif x > 1 and x <= counts[n-1] + 1:
        return req(n - 1, x - 1)
    elif x == counts[n-1] + 2:
        return req(n - 1, counts[n-1]) + 1
    elif x > counts[n-1] + 2:
        if x == 2*counts[n-1] + 3:
            return req(n-1, counts[n-1])*2+1
        else:
            return req(n-1, x - (counts[n-1] + 2) - 1) + req(n - 1, counts[n-1])


print(req(N, X))
Problem p03332 (python)

Fixed submission:
import math

N, A, B, K = map(int, input().split())
mod = 998244353
g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]


def cmb(n, r):
    if (r < 0 or r > n):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod


for i in range(2, N + 1):
    g1.append((g1[-1] * i) % mod)
    inverse.append((-inverse[mod % i] * (mod//i)) % mod)
    g2.append((g2[-1] * inverse[-1]) % mod)

res = 0
for a in range(0, N+1):
    b = (K - A*a) // B
    if (K - A * a) % B == 0 and 0 <= b <= N:
        res += cmb(N, a) * cmb(N, b) % mod
print(res % mod)

Buggy submission (verdict: Runtime Error):
import math

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

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

res = 0
for a in range(0, n+1):
    if (k - A * a) % B == 0:
        b = (k - A*a) // B
        res += combination(n, a) * combination(n, b) % 998244353
print(res)
Problem p03345 (python)

Fixed submission:
a, b, c, k = map(int, input().split())
res = b - a
if k % 2 ==0:
    res = a - b

if res > 10 ** 18:
    print('Unfair')
else:
    print(res)

Buggy submission (verdict: Runtime Error):
n = int(input())
p = [int(input()) for _ in range(n)]
q = [0] * (n+1)

for i in range(n):
    q[p[i]] = i
maxl = 1
cnt = 1
last = p[0]
for i in range(1, n):
    if q[i+1] > q[i]:
        cnt += 1
    else:
        maxl = max(maxl, cnt)
        cnt = 1

print(n - maxl)
Problem p02571 (python)

Fixed submission:
S = input()
T = input()
ans = len(T)
for start in range(len(S) - len(T) + 1):
  dif = 0
  for i in range(len(T)):
    if T[i] != S[start + i]:
      dif += 1
  ans = min(ans, dif) 
print(ans)

Buggy submission (verdict: Runtime Error):
S=input()
T=input()
ANS=[]
for start in range(len(S)-len(T)):
  ans = 0
  for j in range(len(T)):
    if S[start+j] != T[j]:
      ans += 1
  ANS.append(ans)
print(min(ANS))

Buggy submission (verdict: Runtime Error):
S=input()
T=input()
ANS=[]
for start in range(len(S)-len(T)):
  ans = 0
  for j in range(len(T)):
    if S[start] != T[j]:
      ans += 1
  ANS.append(ans)
print(min(ANS))

Buggy submission (verdict: Runtime Error):
S=input()
T=input()
ANS=[]
for start in range(len(S)-len(T)):
  ans = 0
  for j in range(len(T)):
    if S[start] != T[j]:
      ans += 1
  ANS.append(ans)
print(min(ANS))
Problem p02622 (python)

Fixed submission:
S = input()
T = input()
count = 0
for i in range(len(S)):
  if S[i] != T[i]:
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
count = 0
for i in [0:len(S)]:
  if S[i] != T[i]:
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
count = 0
for i in [:len(S)]:
  if S[i] != T[i]:
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
count = 0
for i in [:len(S)]:
  if S[i] == T[i]:
    count += 1
print(count)
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()))

a, b = [0], [0]

for i in range(N):
  a.append(a[i] + A[i])
  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()))

a, b = [0], [0]

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

ans, j = 0, M
for i in range(N+1):
  if a[i] > K:
    break
  while b[i] > K - a[i]:
    j -= 1
  ans = max(ans, i + j)
print(ans)
Problem p02860 (python)

Fixed submission:
N = int(input())
S = input()
print("Yes" if S[:N//2] == S[N//2:] else "No")

Buggy submission (verdict: Runtime Error):
n = int(input())
s = str(input())
if (n % 2 == 1):
  print("No")
else:
  if (s[:n/2+1] = s[n/2+1:]):
    print("Yes")
  else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
s = str(input())
if (n % 2 == 0):
    if (s[:n/2] = s[n/2:]):
      print("Yes")
    else:
     print("No")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
s = str(input())
if (s[:n/2] = s[n/2:]):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
s = str(input())
if (s[:n] * 2  = s):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
s = str(input())
if (s[:n] = s[n:]):
  print("Yes")
else:
  print("No")
Problem p02570 (python)

Fixed submission:
D,T,S=map(int,input().split())
if T>=D/S:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
mod=10**9+7
S=0
M=0
for i in A:
    S+=i
for i in A:
    S-=i
    M+=(S*i)%mod
print(M%mod)
Problem p02629 (python)

Fixed submission:
N=int(input())-1
L=[]
S=[]
A=[chr(i) for i in range(97,123)]
X=""
while N>=0:
  if N==0:
    L.append(N%26)
    N=N//26
    break
  elif N!=0:
    L.append(N%26)
    N=N//26-1
S=list(reversed(L))
for i in range(len(S)):
  X+=A[S[i]]
print(str(X))

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
S=0
B=[0]*10**5+1
for i in A:
    S+=i
    B[i]+=1  #Bは要素数管理
Q=int(input())
C=[list(map(int,input().split())) for i in range(Q)]
for i in range(Q):
    S=S+(C[i][1]-C[i][0])*B[C[i][0]]
    B[C[i][1]]+=B[C[i][0]]
    B[C[i][0]]=0
    print(S)
Problem p03013 (python)

Fixed submission:
N,M=map(int,input().split())
mod=1000000007
a=[0]*(10**5+1)
dp=[0]*(10**5+1)
for i in range(M):
    b=int(input())
    a[b]=1
dp[0]=1
for i in range(1,N+1):
    if a[i]==1:
        continue
    dp[i]+=dp[i-1]
    if i>1:
        dp[i]+=dp[i-2]
    dp[i]=dp[i]%mod
print(dp[N]%mod)

Buggy submission (verdict: Runtime Error):
import itertools as it
def X (n):
    if n%2==0:
        r=n//2
    else:
        r=(n-1)//2
    S=1
    C=1
    for j in range(1,r+1):
        C=len(list(it.combinations(range(n-j),j)))
        S+=C
    return int(S)

N,M=map(int,input().split())
L=[]
a=0
for i in range(M):
    b=int(input())
    L.append(b-a-1)
    a=b
L.append(N-b-1)
A=1
mod=10**9+7
for i in range(len(L)):
    A*=(X(L[i])%mod)
    if L[i]==0 and i>0:
        A=0
        break
print(A%mod)
Problem p02990 (python)

Fixed submission:
from math import factorial
 
def cmb(n, r):
  return factorial(n) // (factorial(n - r) * factorial(r))


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

for i in range(1, K+1):
    try:
        ans = cmb(N - K + 1, i) * cmb(K - 1, i - 1) % (10**9+7)
        print(ans)
    except:
        print(0)

Buggy submission (verdict: Runtime Error):
from math import factorial
 
def cmb(n, r):
  return factorial(n) // (factorial(n - r) * factorial(r))


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

for i in range(1, K+1):
    ans = cmb(N - K + 1, i) * cmb(K - 1, i - 1) % (10**9+7)
    print(ans)

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

mod = 10**9+7
def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under % mod


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

for i in range(1, K+1):
    ans = cmb(N - K + 1, i) * cmb(K - 1, i - 1) % mod
    print(ans)
Problem p02623 (python)

Fixed submission:
#!/usr/bin/env python3

N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))


a = [0]
b = [0]

for i in range(N):
    a.append(a[-1] + A[i])


for i in range(M):
    b.append(b[-1] + B[i])

ret = 0
j = M
for i in range(N+1):
    if a[i] > K:
        break
    while a[i] + b[j] > K:
        j -= 1

    ret = max(i+j, ret)


print(ret)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3

from collections import deque


def book(A2, B2, t, cnt):
    if len(A2) == 0 and len(B2) == 0:
        L.append(cnt)
        return cnt
    elif t == K:
        L.append(cnt)
        return cnt
    elif t > K:
        L.append(cnt-1)
        return cnt - 1

    a_r = 0
    b_r = 0
    if len(A2) != 0:
        a = A2.popleft()
        a_r = book(A2, B2, t+a, cnt+1)
        
    if len(B2) != 0:
        b = B2.popleft()
        b_r = book(A2, B2, t+b, cnt+1)
    L.append(a_r)
    L.append(b_r)
    return max(a_r, b_r)




N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

L = []

A = deque(A)
B = deque(B)

t = 0
ret = 0

ret = book(A, B, 0, 0)

print(max(L))

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3

from collections import deque


def book(A, B, t, cnt):
    if len(A) == 0 and len(B) == 0:
        L.append(cnt)
        return cnt
    elif t == K:
        L.append(cnt)
        return cnt
    elif t > K:
        L.append(cnt-1)
        return cnt - 1

    a_r = 0
    b_r = 0
    if len(A) != 0:
        a = A.popleft()
        a_r = book(A, B, t+a, cnt+1)
        
    if len(B) != 0:
        b = B.popleft()
        b_r = book(A, B, t+b, cnt+1)
    L.append(a_r)
    L.append(b_r)
    return max(a_r, b_r)




N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

L = []

A = deque(A)
B = deque(B)

t = 0
ret = 0

ret = book(A, B, 0, 0)

print(max(L))

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3

from collections import deque


def book(A, B, t, cnt):
    if len(A) == 0 and len(B) == 0:
        return cnt
    elif t == K:
        return cnt
    elif t > K:
        return cnt - 1

    a_r = 0
    b_r = 0
    if len(A) != 0:
        a = A.popleft()
        a_r = book(A, B, t+a, cnt+1)
        
    if len(B) != 0:
        b = B.popleft()
        b_r = book(A, B, t+b, cnt+1)

    return max(a_r, b_r)




N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

A = deque(A)
B = deque(B)

t = 0
ret = 0

ret = book(A, B, 0, 0)

print(ret)
Problem p02891 (python)

Fixed submission:
#!/usr/bin/env python3

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

if len(S) == 1:
    print(K//2)
    exit()

A = []
cnt = 1
C = []
for i in range(1,len(S)):
    if S[i-1] == S[i]:
        cnt += 1
    else:
        C.append([S[i-1], cnt])
        cnt = 1
C.append([S[i], cnt])

ans = 0
if len(C) == 1:
    print((C[0][1]*K) // 2)
    exit()
else:
    for c in C:
        ans += c[1] // 2

ans *= K

ans2 = 0
if S[-1] == S[0]:
    ans2 = ((C[0][1]+C[-1][1])//2 - C[0][1]//2 - C[-1][1]//2) * (K-1)
print(ans + ans2)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3

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

A = []
cnt = 1
C = []
for i in range(1,len(S)):
    if S[i-1] == S[i]:
        cnt += 1
    else:
        C.append([S[i-1], cnt])
        cnt = 1
C.append([S[i], cnt])

ans = 0
S2 = []
for c in C:
    ans += (c[1])//2
    if c[1] == 1:
        S2.append(False)
    else:
        for _ in range(c[1]):
            S2.append(True)

ans *= K

ans2 = 0
if S[0] == S[-1]:
    if S2[-1] == False:
        ans2 += 1

print(ans + ans2*(K-1))
Problem p02912 (python)

Fixed submission:
#!/usr/bin/env python3
import heapq

N, M = map(int, input().split())
A = list(map(int, input().split()))
A = list(map(lambda x: x*(-1), A))  # 各要素を-1倍

heapq.heapify(A)

if N == 1:
    MAX = heapq.heappop(A)//2**M 
    if MAX < 0:
        print(0)
    else:
        print(MAX)
    exit()

cnt = 0
while M > 0:
    MAX = heapq.heappop(A)
    if MAX % 2 == 0:
        heapq.heappush(A, MAX//2)
    else:
        heapq.heappush(A, MAX//2+1)

    M -= 1

print(-sum(A))

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

A = sorted(A)[::-1]

waribiki = 0
index = 0

if len(A)==1:
    print(A[0]//pow(2,M))
    exit()

while waribiki < M:
    if index==0 and A[index] < 3: break
    if A[index]>2 and A[index+1]>2:
        x = A[index] // A[index+1]
        if x+waribiki>M: x = M-waribiki

    if A[index] > 2:
        A[index] = A[index]//pow(2, x)
        waribiki+=x

    index += 1
    if index==N:
        index=0



if waribiki < M:
    index = 0
    while waribiki < M:
        A[index] = A[index] // 2
        waribiki += 1

        index += 1
        if index==N: index=0

        if sum(A)==0:break


print(sum(A))

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

A = sorted(A)[::-1]

waribiki = 0
index = 0

if len(A)==1:
    print(A[0]//pow(2,M))
    exit()

while waribiki < M:
    if index==0 and A[index] < 3: break
    if A[index]>2 and A[index+1]>2:
        x = A[index] // A[index+1]
        if x+waribiki>M: x = M-waribiki

    if A[index] > 2:
        A[index] = A[index]//pow(2, x)
        waribiki+=x

    index += 1
    if index==N:
        index=0



if waribiki < M:
    index = 0
    while waribiki < M:
        A[index] = A[index] // 2

        index += 1
        if index==N: index=0

        if sum(A)==0:break


print(sum(A))

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

A = sorted(A)[::-1]

waribiki = 0
index = 0

if len(A)==1:
    print(A[0]//pow(2,M))
    exit()

while waribiki < M:
    if index < N and A[index]>2 and A[index+1]>2:
        x = A[index] // A[index+1]
        if x+waribiki>M: x = M-waribiki
    else: x = 1

    if A[index] > 2:
        A[index] = A[index]//pow(2, x)
        waribiki+=x

    index += 1
    if index==N: index=0

print(sum(A))
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 a>=3200: print(s)
else: print 'red'
Problem p02951 (python)

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

if c-(a-b)>0:
    print(c-(a-b))
else:
    print(0)

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

if c-(a-b)>0:
    print(c-(a-b))
else:
    print(0
Problem p03013 (python)

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

oks = [True]*(N+1)

for i in range(M):
    a = int(input())
    oks[a] = False

dp = [0]*(N+1)

dp[0]=1
if oks[1]==True: dp[1] = 1

for i in range(2, N+1):
    if oks[i]==True:
        dp[i] = (dp[i-1] + dp[i-2]) % (1e9+7)

print(int(dp[N]))

Buggy submission (verdict: Runtime Error):
def move(now, goal, m):
    global rlt
    if m==goal:
        rlt += 1
        return

    if m>goal: return

    move(m, goal, m+1)
    move(m, goal, m+2)


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

A = [int(input()) for i in range(M)]

for i in range(1, len(A)):
    if A[i]-A[i-1]==1:
        print(0)
        exit()

ans = 0

m = []
now = 0
rlt = 0
for a in A:
    move(now, a-1, now+1)
    move(now, a-1, now+2)
    m.append(rlt)
    rlt = 0

now = A[len(A)-1]+1
move(now, N, now+1)
move(now, N, now+2)
m.append(rlt)

ans = 1

for i in m:
    ans *= i

print(ans%1000000007)
Problem p03127 (python)

Fixed submission:
# -*- coding: utf-8 -*-

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

n = int(input())
x = list(map(int,input().split()))


if n==1:
    print(x[0])
else:
    element = gcd(x[0], x[1])
    if n==2:print(element)
    else:
        for i in range(2,n):
            element=gcd(element,x[i])
        print(element)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import functools
import math
n = input()
monster = list(map(int,input().split()))

gcd = functools.reduce(math.gcd, monster)
print(gcd)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import math
from functools import reduce
def gcd(*numbers):
    return reduce(math.gcd, numbers)
def gcd_list(numbers):
    return reduce(math.gcd, numbers)
n = input()
monster = list(map(int,input().split()))

print(gcd_list(monster))
Problem p03135 (python)

Fixed submission:
d = input().split()
print(float(int(d[0]))/int(d[1]))

Buggy submission (verdict: Runtime Error):
d = input().split()
print(float(d[0])/d[1])
Problem p02951 (python)

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

nokori = a - b
ans = c - nokori
if ans < 0:
    ans = 0
print(ans)

Buggy submission (verdict: Runtime Error):
nokori = a - b
ans = c - nokori
if ans < 0:
    ans = 0
print(ans)