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

Fixed submission:
#C
A,B,C,D,E,F=map(int,input().split())
density=0
Ans1=0
Ans2=0
water=set() 
sugar=set()

bm=F//(100*B)
for i in range(bm+1):
    rw=F-100*i*B
    am=rw//(100*A)
    for j in range(am+1):
        water.add(100*i*B+100*j*A)

dm=F//D
for i in range(dm+1):
    rs=F-i*D
    cm=rs//C
    for j in range(cm+1):
        sugar.add(i*D+j*C)
sugar=sorted(sugar)
water=sorted(water)
for s in sugar:
    for w in water:
        if w/100*E>=s and s+w<=F and s+w!=0:
            den=s/(s+w)
            if den>=density:
                density=den
                Ans1=s+w
                Ans2=s
            else:
                break
print(Ans1,Ans2)

Buggy submission (verdict: Runtime Error):
#C
A,B,C,D,E,F=map(int,input().split())
density=0
Ans1=0
Ans2=0
water=set() #setを使うと重複がなくなる
sugar=set()

bm=F//(100*B)
for i in range(bm+1):
    rw=F-100*i*B
    am=rw//(100*A)
    for j in range(am+1):
        water.add(100*i*B+100*j*A)

dm=F//D
for i in range(dm+1):
    rs=F-i*D
    cm=rs//C
    for j in range(cm+1):
        sugar.add(i*D+j*C)
sugar=sorted(sugar)
water=sorted(water)
for s in sugar:
    for w in water:
        if w/100*E<s:
            pass
        elif s+w>F or s+w==0:
            pass
        else
            den=s/(s+w)
            if den>density:
                density=den
                Ans1=s+w
                Ans2=s
            else:
                pass
print(Ans1,Ans2)

Buggy submission (verdict: Runtime Error):
#C
A,B,C,D,E,F=map(int,input().split())
density=0
Ans1=0
Ans2=0
water=set() #setを使うと重複がなくなる
sugar=set()

bm=F//(100*B)
for i in range(bm+1):
    rw=F-100*i*B
    am=rw//(100*A)
    for j in range(am+1):
        water.add(100*i*B+100*j*A)

dm=F//D
for i in range(dm+1):
    rs=F-i*D
    cm=rs//C
    for j in range(cm+1):
        sugar.add(i*D+j*C)
sugar=sorted(sugar)
water=sorted(water)
for s in sugar:
    for w in water:
        if w/100*E<s:
            pass
        elif s+w>F or s+w=0:
            pass
        else
            den=s/(s+w)
            if den>density:
                density=den
                Ans1=s+w
                Ans2=s
            else:
                pass
print(Ans1,Ans2)
Problem p03943 (python)

Fixed submission:
A=sorted(list(map(int,input().split())),reverse=True)
if A[0]==A[1]+A[2]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
W,H,N=map(int,input().split())
xM=W
xm=0
yM=H
ym=0
for i in range(N):
    a=list(map(int,input().split()))
    if a[2]==1:
        if a[0]>xm:
            xm=a[0]
        else:
            break
    elif a[2]==2:
        if a[0]<xM:
            xM=a[0]
        else:
            break
    elif a[2]==3:
        if a[1]>ym:
            ym=a[1]
        else:
            break
    else:
        if a[1]<yM:
            yM=a[1]
        else: 
            break
xl=xM-xm
yl=yM-ym
print(xl*yl)
Problem p04045 (python)

Fixed submission:
N,K=map(int,input().split())
D=list(map(int,input().split()))
for i in range(N,10*N+1):
    I=list(map(int,str(i)))
    match=list(set(I)&set(D))
    if len(match)==0:
        print(i)
        break
    else:
        pass

Buggy submission (verdict: Runtime Error):
N,K=input().split()
D=list(map(int,input().split()))
for i in N:
    if int(i) in D:
        N[i]+=1
    else:
        pass
print(''.join(N))

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
D=list(map(int,input().split()))
NL=len(str(N))
ans=[]
allnum=list(range(10))
use=list(set(allnum)^set(D))
for i in range(NL):
    a=int(str(N)[i])
    for j in use:
        if a<=j:
            ans.append(j)
            break
        else:
            continue
if ans[0]==0:
    ans[0]=use[1]
else:
    pass
print(int(''.join(map(str,ans))))
Problem p03079 (python)

Fixed submission:
a,b,c = map(int, input().split())
if a == b and b==c:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N, Q = [int(i) for i in input().split()]
S = input()
tdList = reversed([input().split() for _ in range(Q)])

l, r = 0, N - 1
for td in tdList:
    print("td:",td)
    print("S:",S)
    if td[0] == S[l] and td[1] == "L":
        print("pa1")
        l += 1
        print(l,r)
    elif td[0] == S[r] and td[1] == "R":
        print("pa2")
        r -= 1
        print(l,r)
    if l != 0 and S[l - 1] == td[0] and td[1] == "R":
        print("pa3")
        l -= 1
        print(l,r)
    if r != N - 1 and S[r + 1] == td[0] and td[1] == "L":
        print("pa4")
        r += 1
        print(l,r)
    if l > N - 1 or r < 0:
        print(l,r)
        print("break")
        break

ans = 0
if r >= l:
    ans = r - l + 1

print(ans)
Problem p03035 (python)

Fixed submission:
import sys

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

if 6 > a:
	b = 0
elif 13 > a:
	b = b/2

print(int(b))

Buggy submission (verdict: Runtime Error):
import sys

args = sys.argv

if int(args[1]) == 0:
	result = 0
elif 13 > int(args[1]):
	result = int(args[2])/2
else:
	result = args[2]

print(result)

Buggy submission (verdict: Runtime Error):
import sys

args = sys.argv

if int(args[1]) == 0:
	result = 0
elif 13 > int(args[1]):
	result = int(args[2])/2
else:
	result = args[2]

print(result)
Problem p03282 (python)

Fixed submission:
s=input()
k=int(input())
it=int(-1)
sum=int(0)
for i in s:
    if i == '1':
        sum+=1
    else:
        it=sum
        break

if k<=int(it):
    print(1)
elif it == int(-1):
    print(1)
else:
    nex=int(it)+int(1)
    print(s[it:nex])

Buggy submission (verdict: Runtime Error):
s=input()
k=int(input())
it=int(-1)
sum=int(0)
for i in s:
    if i == '1':
        sum+=1
    else:
        it=i

if k<=int(it):
    print(1)
elif it == int(-1):
    print(1)
else:
    print(s[it])

Buggy submission (verdict: Runtime Error):
s=input()
k=int(input())
it=int(-1)
sum=int(0)
for i in s:
    if i == '1':
        sum+=1
    else:
        it=i

if k<=it:
    print(1)
elif it is -1:
    print(1)
else:
    print(s[it])
Problem p03643 (python)

Fixed submission:
s=input()
print("ABC"+s)

Buggy submission (verdict: Runtime Error):
s=input()
print("ABC"+f"{s}")
Problem p03068 (python)

Fixed submission:
n = int(input())
s = input()
k = int(input())
c = s[k-1]
s2 = ""
for m in range(n):
	if s[m] == c:
		s2 += c
	else:
		s2 += '*'
        
print(str(s2))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
k = int(input())
c = s[k-1]
i = s.find(c)
s2 = "*"*n
for n in i:
	s2[n] = c
print(s2)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
k = int(input())
c = s[k-1]
i = s.find(c)
s2 = "*"*n
s2[i] = c
print(s2)
Problem p03606 (python)

Fixed submission:
l = [0]*100005
n = int(raw_input())
for x in xrange(n):
	a = map(int,raw_input().strip().split())
	for y in xrange(a[0],a[1]+1):
		l[y] = 1
ans = 0
for x in l:
	if x == 1:
		ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
l = [0]*100000
n = int(raw_input())
for x in xrange(n):
	a = map(int,raw_input().strip().split())
	for y in xrange(a[0],a[1]+1):
		l[y] = 1
ans = 0
for x in l:
	if x == 1:
		ans += 1
print(ans)
Problem p04043 (python)

Fixed submission:
a = map(int, raw_input().strip().split())
a.sort()
if a[0] == 5 and a[1] == 5 and a[2] == 7:
	print('YES')
else:
	print("NO")

Buggy submission (verdict: Runtime Error):
a = map(int, raw_input().strip().split())
sort(a)
if a[0] == 5 and a[1] == 5 and a[2] == 7:
	print('YES')
else:
	print("NO")
Problem p03962 (python)

Fixed submission:
a, b, c =map(int, open(0).read().split())
if a == b and b == c:
  print(1)
elif a == b or b == c or a == c:
  print(2)
else:
  print(3)

Buggy submission (verdict: Runtime Error):
a, b =map(int, open(0).read().split())
if a < b:
  c = 2 * b - 1
  print(c)
if a == b:
  c = 2 * a
  print(c)
else:
  c = 2 * a -1
  print(c)
Problem p03030 (python)

Fixed submission:
from sys import stdin


def sortFirst(val):
    return val[0]
N=stdin.readline().rstrip()
N=int(N)
l={}
for i in range(1,N+1):
    S,P = stdin.readline().rstrip().split()
    if S in l.keys():
        l[S].append([int(P),i])

    else:
        l[S]=[[int(P),i]]


for key in l.keys():
    l[key].sort(key=sortFirst,reverse=True)
for key in sorted(l):
    for val in l[key]:
        print(val[1])

Buggy submission (verdict: Runtime Error):
from sys import stdin


def sortFirst(val):
    return val[0]
N=stdin.readline().rstrip()
N=int(N)
l={}
for i in range(1,N+1):
    S,P = stdin.readline().rstrip().split()
    if S in l.keys():
        l[S].append([int(P),i])

    else:
        l[S]=[[int(P),i]]


for key in l.keys():
    l[key].sort(key=sortFirst,reverse=True)
for key in sorted(l):
    for val in l[key]:
        print "%d"%(val[1])

Buggy submission (verdict: Runtime Error):
import collections
def sortFirst(val):
    return val[0]
N=raw_input("")
N=int(N)
l={}
for i in range(1,N+1):
    S,P = raw_input("").split(' ')
    if S in l.keys():
        l[S].append([int(P),i])

    else:
        l[S]=[[int(P),i]]


for key in l.keys():
    l[key].sort(key=sortFirst,reverse=True)
for key in sorted(l):
    for val in l[key]:
        print "%d"%(val[1])
Problem p03029 (python)

Fixed submission:
S = input()
A,P = S.split(' ')
print( (int(A)*3+int(P))//2 )

Buggy submission (verdict: Runtime Error):
A = int(input())
P = int(input())
print( (A*3+P)//2 )
Problem p03417 (python)

Fixed submission:
a, b = [int(x) for x in input().split(" ")]
print(abs((a-2)*(b-2)))

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

print(abs((a-2)*(b-2)))
Problem p03110 (python)

Fixed submission:
import sys


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

# N = int(input())
# A = [int(x) for x in input().split()]
# a, b, c = map(int, input().split())
# name1 = str(input())
# alph = {"A": 1, "B": 2, "C": 3, "D": 4, "E": 5}
# b = list(map(lambda x: math.ceil(x/10)*10, a))


N = int(input())

sum = 0
for _ in range(N):
    x, u = input().split()
    if u == 'JPY':
        sum += float(x)
    else:
        sum += float(x) * 380000.0

print(sum)

Buggy submission (verdict: Runtime Error):
import sys


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

# N = int(input())
# A = [int(x) for x in input().split()]
# a, b, c = map(int, input().split())
# name1 = str(input())
# alph = {"A": 1, "B": 2, "C": 3, "D": 4, "E": 5}
# b = list(map(lambda x: math.ceil(x/10)*10, a))


n = int(input())
ans = 0
for _ in range(n):
    x, u == map(str, input().split())
    if u == "JPY":
        ans += int(x)
    else:
        ans += int(x)*380000.0
print(ans)
Problem p03219 (python)

Fixed submission:
import sys


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

# N = int(input())
# A = [int(x) for x in input().split()]
# a, b, c = map(int, input().split())
# name1 = str(input())
# alph = {"A": 1, "B": 2, "C": 3, "D": 4, "E": 5}


a,b=map(int,input().split())
print(a+int(b/2))

Buggy submission (verdict: Runtime Error):
import sys


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

# N = int(input())
# A = [int(x) for x in input().split()]
# a, b, c = map(int, input().split())
# name1 = str(input())
# alph = {"A": 1, "B": 2, "C": 3, "D": 4, "E": 5}


a,b=map(int,input().splpit())
print(a+int(b/2))
Problem p03351 (python)

Fixed submission:
import sys


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

# N = int(input())
# A = [int(x) for x in input().split()]
# a, b, c = map(int, input().split())
# name1 = str(input())
# alph = {"A": 1, "B": 2, "C": 3, "D": 4, "E": 5}


a, b, c, d = map(int, input().split())
if abs(a-c) <= d or (abs(a-b) <= d and abs(b-c) <= d):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import sys


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

# N = int(input())
# A = [int(x) for x in input().split()]
# a, b, c = map(int, input().split())
# name1 = str(input())
# alph = {"A": 1, "B": 2, "C": 3, "D": 4, "E": 5}


a, b ,c,d= map(int, input().split())
if abs(a,c)<=d or abs(a,b)<=d and abs(b,c)<=d:
    print("Yes")
else:
    print("No")
Problem p03555 (python)

Fixed submission:
import sys


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

# N = int(input())
# A = [int(x) for x in input().split()]
# a, b, c = map(int, input().split())
# name1 = str(input())
# alph = {"A": 1, "B": 2, "C": 3, "D": 4, "E": 5}


a=str(input())
b=str(input())

if a[0] == b[-1] and a[1] == b[-2] and a[2] == b[-3]:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
import sys


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

# N = int(input())
# A = [int(x) for x in input().split()]
# a, b, c = map(int, input().split())
# name1 = str(input())
# alph = {"A": 1, "B": 2, "C": 3, "D": 4, "E": 5}


a, b, c = map(str, input().split())
e,f,g = map(str, input().split())
if a==g and b==f and c==e:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
import sys


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

# N = int(input())
# A = [int(x) for x in input().split()]
# a, b, c = map(int, input().split())
# name1 = str(input())
# alph = {"A": 1, "B": 2, "C": 3, "D": 4, "E": 5}


a, b, c = map(int, input().split())
e,f,g = map(int, input().split())
if a==g and b==f and c==e:
    print("YES")
else:
    print("NO")
Problem p03852 (python)

Fixed submission:
a = str(input())
flag = 0
for i in {"a", "i", "u", "e", "o"}:
    if a == i:
        flag = 1
        print("vowel")
if flag == 0:
    print("consonant")

Buggy submission (verdict: Runtime Error):
a = str(input())
for i in {"a", "i", "u", "e", "o"}:
    if a == i:
        flag = 1
        print("vowel")
if flag == 0:
    print("consonant")
Problem p03962 (python)

Fixed submission:
a, b, c = map(int, input().split())
if a == b and b == c:
    print(1)
elif a == b and b != c or b == c and a != b or a==c and a!=b:
    print(2)
else:
    print(3)

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
if a == b and b == c:
    print(1)
elif a == b and b != c or b == c and a != b or a==c and a!=b
    print(2)
else:
    print(3)
Problem p03086 (python)

Fixed submission:
s = input()

max_count = 0
count = 0

for i in s:
    if i not in ['A', 'C', 'G', 'T']:
        count = 0
        continue
    count += 1
    max_count = max(max_count, count)

print(max_count)

Buggy submission (verdict: Runtime Error):
import re

s = input()

regex = re.compile('[ACGT]+')

l = 0

for i in range(len(s)):
    r1 = regex.match(s[:i])
    r2 = regex.match(s[i:])
    if r1 and r1[0]:
        l = max(l, len(r1[0]))
    if r2 and r2[0]:
        l = max(l, len(r2[0]))

print(l)

Buggy submission (verdict: Runtime Error):
import re

s = input()

regex = re.compile('[ACGT]+')

l = 0

for i in range(len(s)):
    r1 = regex.match(s[:i])
    r2 = regex.match(s[i:])
    if r1:
        l = max(l, len(r1[0]))
    if r2:
        l = max(l, len(r2[0]))

print(l)

Buggy submission (verdict: Runtime Error):
import re

s = input()

regex = re.compile('[ACGT]+')

l = 0

for i in range(len(s)):
    r = regex.match(s[i:])
    if r:
        l = max(l, len(r[0]))

print(l)
Problem p03032 (python)

Fixed submission:
N, K = map(int, input().split())
V = list(map(int, input().split()))
ans = 0
for L in range(min(N, K+1)):
    for R in range(min(N-L, K-L)+1):
        js = V[:L] + V[-R:] if R > 0 else V[:L]
        t = K - L - R
        s = 0
        for i in sorted(js):
            if i < 0 and t > 0:
                s += -i
                t -= 1
        ans = max(ans, sum(js) + s)
print(ans)

Buggy submission (verdict: Runtime Error):
def handPop(hand):
    min_val = hand.pop(hand.index(min(hand)))
    return hand, min_val

N, K = map(int, input().split())
V = list(map(int, input().split()))
hand = []
ps = []
def func(V, hand, K):
    if K < 1:
        ps.append(hand)
        return
    if len(hand) > 0 and min(hand) < 0:
        hand_ = hand[:]
        hand_, min_val = handPop(hand_)
        C = func([min_val] + V, hand_, K-1)
        D = func(V + [min_val], hand_, K-1)
        A = func(V[1:], hand+[V[0]], K-1)
        B = func(V[:-1], hand+[V[-1]], K-1)
    else:
        A = func(V[1:], hand+[V[0]], K-1)
        B = func(V[:-1], hand+[V[-1]], K-1)

    
func(V, hand, K)
v_max = max([sum(x) for x in ps])
print(v_max if v_max > 0 else 0)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
V = list(map(int, input().split()))
hand = []
ps = []
def func(V, hand, K):
    if K < 1:
        ps.append(hand)
        return
    if len(hand) > 0 and min(hand) < 0:
        hand_ = hand[:]
        hand_, min_val = handPop(hand_)
        C = func([min_val] + V, hand_, K-1)
        D = func(V + [min_val], hand_, K-1)
        A = func(V[1:], hand+[V[0]], K-1)
        B = func(V[:-1], hand+[V[-1]], K-1)
    else:
        A = func(V[1:], hand+[V[0]], K-1)
        B = func(V[:-1], hand+[V[-1]], K-1)

    
func(V, hand, K)
v_max = max([sum(x) for x in ps])
print(v_max if v_max > 0 else 0)
Problem p03067 (python)

Fixed submission:
A,B,C = map(int,input().split())
if A>C & C>B:
	print("Yes")
if B>C & C>A:
   	print("Yes")
if C>A & A>B:
	print("No")
if B>A & A>C:
	print("No")
if A>B & B>C:
	print("No")
if C>B & B>A:
	print("No")

Buggy submission (verdict: Runtime Error):
A,B,C = map(int,input().split())
if A<C & C<B:
	print("yes")
else:
  if A>C & C>B:
    print("yes")
  else:
	print("No")
Problem p03068 (python)

Fixed submission:
N=int(input())
S=input()
K=int(input())
Slist =list(S)
for i in range(N):
	if Slist[K-1] == Slist[i]:
		continue
	else:
		Slist[i]="*"
S = ''.join(Slist)
print(S)

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input()
K=int(input())
Slist =list(S)
for i in range(N):
	if Slist[K] == Slist[i]:
		continue
	else:
		Slist[i]="*"
S = ''.join(Slist)
print(S)
Problem p03029 (python)

Fixed submission:
def pie(A, P):
    P_cra = A*3
 
    P_all = P_cra + P
 
    pie = P_all//2
 
    print(pie)

l = list(map(int, input().split()))
A = int(l[0])
P = int(l[1])
pie(A, P)

Buggy submission (verdict: Runtime Error):
def pie(A, P):
    P_cra = A*3
 
    P_all = P_cra + P
 
    pie = P_all//2
 
    print(pie)

A = input()
P = input()
pie(int(A), int(P))

Buggy submission (verdict: Runtime Error):
def pie(A, P):
    P_cra = A*3

    P_all = P_cra + P

    pie = P_all//2

    print(pie)

A, P = input(), input()
pie(A, P)
Problem p03139 (python)

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

N = l[0]
x = l[1]
y = l[2]

if N > x + y:
    b_min = 0
else:
    b_min = (x + y) - N

if x > y:
    b_max = y
else:
    b_max = x

if N == x and N == y:
    b_min = N
    b_max = N

print(b_max, b_min)

Buggy submission (verdict: Runtime Error):
N = int(input())
A_dict = {}
B_dict = {}
i = 0
flg = 0
while i < N:
    l = list(map(int, input().split()))
    A = l[0]
    B = l[1]
    A_dict[str(i)] = A
    B_dict[str(i)] = B
    if flg == 0 and A != B:
        flg = 1
    i+=1

taka = 0
aoki = 0
for i in range(N):
    if flg == 0:
        A_max_key = max(A_dict, key=A_dict.get)
        taka += A_dict[str(A_max_key)]

        if len(A_dict) != 0:
            A_dict.pop(A_max_key)
        if len(B_dict) != 0:
            B_dict.pop(A_max_key)
        if len(B_dict) == 0:
            break

        B_max_key = max(B_dict, key=B_dict.get)
        aoki += max(B_dict.values())

        if len(A_dict) != 0:
            A_dict.pop(B_max_key)
        if len(B_dict) != 0:
            B_dict.pop(B_max_key)
        if len(A_dict) == 0:
            break
    else:
        B_max_key = max(B_dict, key=B_dict.get)
        taka += A_dict[B_max_key]

        if len(A_dict) != 0:
            A_dict.pop(B_max_key)
        if len(B_dict) != 0:
            B_dict.pop(B_max_key)
        if len(B_dict) == 0:
            break

        B_max_key = max(B_dict, key=B_dict.get)
        aoki += max(B_dict.values())

        if len(A_dict) != 0:
            A_dict.pop(B_max_key)
        if len(B_dict) != 0:
            B_dict.pop(B_max_key)
        if len(B_dict) == 0:
            break

print(taka, aoki)
Problem p03447 (python)

Fixed submission:
x = int(input())
A = int(input())
B = int(input())

x = x-A
n = x//B
print(x-n*B)

Buggy submission (verdict: Runtime Error):
x = int(input())
A = int(input())
B = int(input())

x = x-A
n = x//B
print(x-n+*B)
Problem p03477 (python)

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

if a+b < c+d :
    print("Right")
elif a+b > c+d:
    print("Left")
else:
    print("Balanced")

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

if a+b < c+d :
    print("Left")
elif a+b > c+d:
    print("Right")
else:
    print("Balanced")
Problem p03943 (python)

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

if l[0] == l[1] + l[2] or l[1] == l[0] + l[2] or l[2] == l[0] + l[1]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
l = sum(map(int, input().split()))
n = sum(l)%3
if n == 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
l = sum(map(int, input().split()))
n = sum(l)%3
if n == 0:
    print("YES")
else:
    print("NO")
Problem p03485 (python)

Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Sun Feb 24 22:23:09 2019

@author: yuta
"""
import math

def pmean(a,b):
    x = math.ceil((a + b)/2)
    print(x)

c = input().split()
pmean(int(c[0]),int(c[1]))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 25 00:39:05 2019

@author: yuta
"""

def dic(n,m):
    x = ''.join(sorted(n))
    y = ''.join(sorted(m,reverse = True))
    if x < y:
        print("Yes")
    else:
        print("No")
dic(input(),input())
Problem p03048 (python)

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


def main():
    R, G, B, N = [int(ele) for ele in input().split()]
    ans = 0
    for i in range(N+1):
        tmp = N - i*R

        for j in range(N+1):
            tmp2 = tmp - j*G
            if tmp2 < 0:
                break
            if tmp2 % B == 0:
                ans += 1

    print(ans)


if __name__ == "__main__":
    main()

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


def main():
    R, G, B, N = [int(ele) for ele in input().split()]
    ans = 0
    for i in range(N+1):
        tmp = N - i*R

        for j in range(N+1):
            tmp2 = tmp - j*G
            if tmp2 < 0:
                break
            if tmp2 % B == 0:
                ans += 1

    print(ans)


def make_prim_nu(n):
    np.set_printoptions(threshold=np.inf)   # 配列の ... 表示を抑制
    N = n                  # 引数の上限値を含める
    is_prime = np.ones((N,), dtype=bool)
    is_prime[:2] = 0
    N_max = int(np.sqrt(N))
    for j in range(2, N_max+1):
        if(is_prime[j]):
            is_prime[j*j::j] = False        # 素数jの間隔で消していく
    primes = np.arange(N)[is_prime]
    return primes


def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    return divisors


if __name__ == "__main__":
    main()