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

Fixed submission:
n,k=map(int,input().split())
a=list(map(int,input().split()))
for i in range(n-k):
  if a[i]<a[i+k]:
    print('Yes')
  else:
    print('No')

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=list(map(int,input().split()))
for i in range(n-k+1):
  if a[i]<a[i+k]:
    print('Yes')
  else:
    print('No')

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=list(map(int,input().split()))
for i in range(n-k+1):
  if a[i]<a[i+k+1]:
    print('Yes')
  else:
    print('No')

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=list(map(int,input().split()))
b=[0]*k
for j in range(n-k+1):
  x=1  
  for i in range(j,j+k):
    x*=a[i]
  b[i-1]=x

for m in range(len(b)-1):
  if b[m]<b[m+1]:
    print("Yes")
  else:
    print("No")

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=list(map(int,input().split()))
b=[0]*k
for j in range(n-k+1):
  x=1  
  for i in range(j,j+k):
    x*=a[i]
  b[i-k]=x

for m in range(len(b)-1):
  if b[m]<b[m+1]:
    print("Yes")
  else:
    print("No")
Problem p02607 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
c=0
for i in range(0,len(a),2):
  if a[i]%2==1:
    c+=1
print(c)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
c=0
for i in range(1,len(a)+1,2):
  if a[i]%2==1:
    c+=1
print(c)
Problem p02641 (python)

Fixed submission:
import sys
x,n=map(int,input().split())
p=list(map(int,input().split()))
c=0
if n==0:
  print(x)
  sys.exit()
for i in range(x,-200,-1):
  
  if not i in p:
    print(i)
    sys.exit()
  if not (x+c) in p:
    print(x+c)
    sys.exit()
  c+=1

Buggy submission (verdict: Runtime Error):
import sys
x,n=map(int,input().split())
p=list(map(int,input().split()))
c=0
if n==0:
  print(x)
  sys.exit()
for i in range(x,-200,-1):
  
  if not i in p:
    print(i)
    sys.exit()
  if not (x+c) in p:
    print(x+c)
    sys.exit()
　c+=1
Problem p02646 (python)

Fixed submission:
A,V=map(int,input().split())
B,W=map(int,input().split())
T=int(input())
if A>B:
  A,B=B,A
if A+V*T>=B+W*T:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
A,V=map(int(input().split()))
B,W=map(int(input().split()))
T=int(input())
if A+V*T>=B+W*T:
  print('YES')
else:
  print('NO')
Problem p02658 (python)

Fixed submission:
import sys
N=int(input())
A=list(map(int,input().split()))
if 0 in A:
  print('0')
  sys.exit()
x=1
for i in A:
  x*=i
  if x>1000000000000000000:
    print('-1')
    sys.exit()
print(x)

Buggy submission (verdict: Runtime Error):
import sys
N=int(input())
A=list(map(int,input().split()))
x=1
for i in A:
  x*=i
  if x>1000000000000000000:
  print('-1')
  sys.exit()
print(x)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
x=1
for i in A:
  x*=i
	if x>1000000000000000000:
  	print('-1')
    break
else:
  print(x)
Problem p02765 (python)

Fixed submission:
N,R=map(int,input().split())
if N>=10:
  print(R)
else:
  print(R+100*(10-N))

Buggy submission (verdict: Runtime Error):
N,R=map(int,input().split())
if N>=10:
  print(R)
else:
  print(R+100*(10-K))

Buggy submission (verdict: Runtime Error):
N,R=map(int,input().split())
if N>=10:
  print('R')
else:
  print('{}'.format(R+100*(10-K)))

Buggy submission (verdict: Runtime Error):
N,R=map(int,input().split())
if N>=10:
  print('R')
else:
  print(R+100*(10-K))
Problem p02778 (python)

Fixed submission:
S=input()
print("x"*len(S))

Buggy submission (verdict: Runtime Error):
S=input()
for i in range(len(S)):
  S[i]=x
print(S)
Problem p02812 (python)

Fixed submission:
N=int(input())
S=input()
result=0
for i in range(N):
  if S[i:i+3]=='ABC':
    result+=1
print(result)

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input()
result=0
for i in range(N):
  if [i:i+3]=='ABC':
    result+=1
print(result)

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input()
result=0
for i in range(N):
  if [i:i+3]=='ABC':
    result+=!
print(result)
Problem p02830 (python)

Fixed submission:
N=int(input())
S,T=input().split()
ans=str()
for i in range(N):
  ans+=S[i]
  ans+=T[i]
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
S,T=input().split()
for i in range(N):
  U+=S[i]+T[i]
print(' '.join(U))
Problem p02899 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=[0]*n
for i,j in enumerate(a,1):
  b[j-1]=i
print(*b)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
b=a
k=1
for i,j in enumerate(a,1):
  b[j]=i
print(*b)
Problem p02923 (python)

Fixed submission:
n=int(input())
h=list(map(int,input().split()))
c=0
t=0

for i in range(n-1):
  if h[i]>=h[i+1]:
    c+=1
  else:
    t=max(t,c)
    c=0
  t=max(t,c)
print(t)

Buggy submission (verdict: Runtime Error):
import sys
n=int(input())
h=list(map(int,input().split()))
c=0
t=[]
if n==1:
    print('0')
    sys.exit
for i in range(n-1):
  if h[i]>=h[i+1]:
    c+=1
  else:
    t.append(c)
    c=0
  t.append(c)
print(max(t))

Buggy submission (verdict: Runtime Error):
n=int(input())
h=list(map(int,input().split()))
c=0
t=[]
for i in range(n-1):
  if h[i]>=h[i+1]:
    c+=1
  else:
    t.append(c)
    c=0
  t.append(c)
print(max(t))

Buggy submission (verdict: Runtime Error):
n=int(input())
h=list(map(int,input().split())
c=0
le=[]       
for i in range(n-1):
    if h[i]>=h[i+1]:
       c+=1
    else:
       le.append(c)
       c=0
print(max(le))
Problem p02600 (python)

Fixed submission:
x = int(input())
cnt = 6
while True:
    if x < cnt*100:
        break
    cnt += 2
print(int(11 - cnt / 2))

Buggy submission (verdict: Runtime Error):
red, green, blue = map(int, input().split())
k = int(input())
success = 0
for cnt in range(k+1):
    if red >= green:
        green *= 2
    elif red >= blue:
        blue *= 2
    elif green >= blue:
        blue *= 2
    else:
        success = 1
        break
if success == 1:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
red, green, blue = map(int, input().split())
k = int(input())
success = 0
for cnt in range(k+1):
    if red >= green:
        green *= 2
    elif red >= blue:
        blue *= 2
    elif green >= blue:
        blue *= 2
    else:
        success = 1
        break
if success == 1:
    print('Yes')
else:
    print('No')
Problem p03943 (python)

Fixed submission:
p = list(map(int, input().split()))
p.sort()
print('Yes' if p[0]+p[1]==p[2] else 'No')

Buggy submission (verdict: Runtime Error):
p = list(map(int, input().split())).sort()
print('Yes' if p[0]+p[1]==p[2] else 'No')
Problem p03998 (python)

Fixed submission:
Sa = list(input())
Sb = list(input())
Sc = list(input())
card = Sa.pop(0)
while True:
    if card == 'a':
        S = Sa
    if card == 'b':
        S = Sb
    if card == 'c':
        S = Sc
    try:
        card = S.pop(0)
    except:
        print(card.upper())
        break

Buggy submission (verdict: Runtime Error):
S = Sa
card = S.pop(0)
while True:
    if card == 'a':
        S = Sa
    if card == 'b':
        S = Sb
    if card == 'c':
        S = Sc
    try:
        card = S.pop(0)
    except:
        print(card.upper())
        break
Problem p02630 (python)

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

n = int(input())
a = list(map(int, input().split()))
q = int(input())
info = []
for i in range(q):
    info.append(list(map(int, input().split())))

a_dict = dict()
for num in a:
    if num in a_dict.keys():
        a_dict[num] += 1
    else:
        a_dict[num] = 1

a_key = list(a_dict.keys())
a_value = list(a_dict.values())
ans = 0
for k in range(len(a_dict)):
    ans += a_key[k] * a_value[k]

for j in range(q):
    if info[j][0] in a_dict.keys():
        if info[j][1] in a_dict.keys():
            ans -= info[j][0] * a_dict[info[j][0]]
            ans += info[j][1] * a_dict[info[j][0]]
            a_dict[info[j][1]] += a_dict[info[j][0]]
            del a_dict[info[j][0]]
        else:
            ans -= info[j][0] * a_dict[info[j][0]]
            a_dict[info[j][1]] = a_dict[info[j][0]]
            ans += info[j][1] * a_dict[info[j][1]]
            del a_dict[info[j][0]]


    print(ans)

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

n = int(input())
a = list(map(int, input().split()))
q = int(input())
info = []
for i in range(q):
    info.append(list(map(int, input().split())))

a_dict = dict()
for num in a:
    if num in a_dict.keys():
        a_dict[num] += 1
    else:
        a_dict[num] = 1

a_key = list(a_dict.keys())
a_value = list(a_dict.values())
for k in range(len(a_dict)):
    ans += a_key[k] * a_value[k]

for j in range(q):
    if info[j][0] in a_dict.keys():
        if info[j][1] in a_dict.keys():
            ans -= info[j][0] * a_dict[info[j][0]]
            ans += info[j][1] * a_dict[info[j][1]]
            a_dict[info[j][1]] += a_dict[info[j][0]]
            del a_dict[info[j][0]]
        else:
            ans -= info[j][0] * a_dict[info[j][0]]
            a_dict[info[j][1]] = a_dict[info[j][0]]
            ans += info[j][1] * a_dict[info[j][1]]
            del a_dict[info[j][0]]
    ans = 0

    print(ans)
Problem p02663 (python)

Fixed submission:
h1, m1, h2, m2, k = map(int, input().split())
 
if h1 <= h2:
    time = h2 * 60 + m2 - h1 * 60 - m1
else:
    time = (h2+24) * 60 + m2 - h1 * 60 - m1
if k >= time:
    print(0)
else:
    print(time - k)

Buggy submission (verdict: Runtime Error):
if h1 <= h2:
    time = h2 * 60 + m2 - h1 * 60 + m1
else:
    time = (h2+24) * 60 + m2 - h1 * 60 + m1
if k >= time:
    print(0)
else:
    print(time - k)

Buggy submission (verdict: Runtime Error):
h1, m1, h2, m2. k = map(int, input().split())

time = h2 * 60 + m2 - h1 * 60 + m1
if k >= time:
    print(1)
else:
    print(time - k)
Problem p02683 (python)

Fixed submission:
import numpy as np
n,m,x = map(int,input().split())
info = []
for i in range(n):
    info.append(list(map(int,input().split())))
info = np.array(info)


money = np.sum(info, axis = 0)[0]
flag = 0
for i in range(2**n):
    tem = np.zeros(m+1, dtype = int)
    for j in range(n):
        if ((i >> j) & 1):
            tem += info[j]
    skill = tem[1:]
    non = np.all(skill >= x)
    if non:
        flag = 1
        if tem[0] < money:
            money = tem[0]

if flag == 0:
    print(-1)
else:
    print(money)

Buggy submission (verdict: Runtime Error):
import numpy as np
n,m,x = map(int,input().split())
info = []
for i in range(n):
    info.append(list(map(int,input().split())))
info = np.array(info)

money = np.sum(info, axis = 0)[0]
flag = 0
for i in range(2**n):
    tem = np.zeros(m+1)
    for j in range(n):
        if (i >> j) & 1:
            tem += info[j]
    non = np.any(tem < 10)
    if non == False:
        flag = 1
        if tem[0] < money:
            money = tem[0]

if flag == 0:
    print(-1)
else:
    print(money)
Problem p02713 (python)

Fixed submission:
import math

k = int(input())
sum = 0
gcds = [[0 for i in range(k)] for i in range(k)]
for p in range(1,k+1):
    for q in range(1,k+1):   
        gcds[p-1][q-1] = math.gcd(p,q)          
        for r in range(1,k+1):
            sum += math.gcd(gcds[p-1][q-1], r)
            


print(sum)

Buggy submission (verdict: Runtime Error):
import numpy as np

k = input()
sum = 0
for p in range(k):
    for q in range(k):
        for r in range(k):
            sum += np.gcd.reduce([i,j,k])

print(sum)
Problem p02761 (python)

Fixed submission:
n,m = map(int, input().split())
s_and_c = []
for i in range(m):
    s_and_c.append(list(map(int, input().split())))

ans = ["-1" for i in range(n)]
s_and_c.sort()


if m == 0:
    if n == 1:
        ans = ["0"]
    else:
        ans[0] = "1"

elif n != 1 and s_and_c[0][0] == 1 and s_and_c[0][1] == 0:
    ans = -1
else:
    for i in range(m):
        if ans[s_and_c[i][0] - 1] == "-1":
            ans[s_and_c[i][0] - 1] = str(s_and_c[i][1])
        elif ans[s_and_c[i][0] - 1] == str(s_and_c[i][1]):
            continue
        else:
            ans = -1


if ans != -1:
    for i in range(n):
        if ans[i] == "-1":
            if i == 0:
                ans[i] = "1"
            else:
                ans[i] = "0"
    ans = "".join(ans)

print(ans)

Buggy submission (verdict: Runtime Error):
n,m = map(int, input().split())
s_and_c = []
for i in range(m):
    s_and_c.append(list(map(int, input().split())))

ans = ["-1" for i in range(n)]
s_and_c.sort()


if m == 0:
    if n == 1:
        ans = ["0"ß]
    else:
        ans[0] = "1"

elif n != 1 and s_and_c[0][0] == 1 and s_and_c[0][1] == 0:
    ans = -1
else:
    for i in range(m):
        if ans[s_and_c[i][0] - 1] == "-1":
            ans[s_and_c[i][0] - 1] = str(s_and_c[i][1])
        elif ans[s_and_c[i][0] - 1] == str(s_and_c[i][1]):
            continue
        else:
            ans = -1


if ans != -1:
    for i in range(n):
        if ans[i] == "-1":
            ans[i] = "0"
    ans = "".join(ans)

print(ans)

Buggy submission (verdict: Runtime Error):
n,m = map(int, input().split())
s_and_c = []
for i in range(m):
    s_and_c.append(list(map(int, input().split())))

ans = ["-1" for i in range(n)]
s_and_c.sort()

if n != 1 and s_and_c[0][0] == 1 and s_and_c[0][1] == 0:
    ans = -1
else:
    for i in range(m):
        if ans[s_and_c[i][0] - 1] == "-1":
            ans[s_and_c[i][0] - 1] = str(s_and_c[i][1])
        elif ans[s_and_c[i][0] - 1] == str(s_and_c[i][1]):
            continue
        else:
            ans = -1


if ans != -1:
    for i in range(n):
        if ans[i] == "-1":
            ans[i] = "0"
    ans = "".join(ans)

print(ans)
Problem p02772 (python)

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

for i in range(n + 1):
    if i == n:
        print("APPROVED")
    else:
        if info[i] % 2 == 0:
            if info[i] % 3 == 0 or info[i] % 5 == 0:
                continue
            else:
                print("DENIED")
                break

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

for i in n:
    if i % 2 == 0:
        if i % 3 == 0 or i % 5 == 0:
            if i == n:
                print("APPROVED")
            else:
                continue
        else:
            print("DENIED")
            break
Problem p02947 (python)

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

n = int(input())
note = dict()
ans = 0
for i in range(n):
    s = "".join(sorted(sys.stdin.readline()))
    if s in note.keys():
        ans += note[s]
        note[s] += 1
    else:
        note[s] = 1

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
note = dict()
for i in range(n):
    s = "".join(sorted(input()))
    if s in note.keys():
        note[s] += 1
    else:
        note[s] = 1
        
import collections
c = collections.deque(note.values())
ans = 0
for i in range(c):
    q = c.popleft()
    ans += q*(q-1)//2

print(ans)
Problem p02958 (python)

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

p_sort=sorted(info)
tem_1=0
tem_2=0
tem=0
for i in range(n-1):
  if info[i]>info[i+1]:
    tem_1=i
    for j in range(n-i-2):
      if info[i+j+1]>info[i+j+2]:
        tem_2=i+j+2
        break
    break
tem=info[tem_1]
info[tem_1]=info[tem_2]
info[tem_2]=tem


for i in range(n):
  if info[i]!=p_sort[i]:
    print("NO")
    break
  
  if i==n-1:
    print("YES")

Buggy submission (verdict: Runtime Error):
7
1 2 3 4 5 6 7
Problem p02995 (python)

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

import fractions
lcmcd = c * d // fractions.gcd(c,d)
bc = b // c
ac = a // c
bd = b // d
ad = a // d
blcmcd = b // lcmcd
alcmcd = a // lcmcd

if a % c != 0:
    ac += 1
if a % d != 0:
    ad += 1
if a % lcmcd != 0:
    alcmcd += 1

print((b - a + 1) - ((bc - ac + 1) + (bd - ad + 1) - (blcmcd -alcmcd + 1)))

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

from math import gcd
c_d=c*d/gcd(c,d)
if a%c==0:
    wari_c=int(b//c-a//c+1)
else:
    wari_c=int(b//c-a//c)
if a%d==0:
    wari_d=int(b//d-a//d+1)
else:
    wari_d=int(b//d-a//d)
if a%c_d==0:
    wari_c_d=int(b//c_d-a//c_d+1)
else:
    wari_c_d=int(b//c_d-a//c_d)

print(b-a+1-(wari_c+wari_d-wari_c_d))

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

from math import gcd
c_d=c*d/gcd(c,d)
wari_c=int(b//c-a//c)
wari_d=int(b//d-a//d)
wari_c_d=int(b//c_d-a//c_d)

print(b-a+1-(wari_c+wari_d-wari_c_d))

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

from math import gcd
c_d=c*d/gcd(c,d)
wari_c=int(b//c-a//c)
wari_d=int(b//d-a//d)
wari_c_d=int(b//c_d-a//c_d)

print(b-a+1-(wari_c+wari_d-wari_c_d))
Problem p03005 (python)

Fixed submission:
n,k=map(int,input().split())

if(k==1):
    print(0)
else:
    print(n-k)

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

if(k=1):
    print(0)
else:
    print(n-k)
Problem p03035 (python)

Fixed submission:
a,b = map(int, input().split())
 
if a >= 13:
  print(b)
elif 6 <= a and a <= 12:
  print(int(b/2))
else:
  print(0)

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().split())
 
if a >= 13:
  print(b)
elif 6 <= a && a <= 12:
  print(int(b/2))
else:
  print(0)

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

if a >= 13:
  print(b)
elif 6 <= a && a <= 12:
  print(b/12)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
cards = []
for i in range(m):
    cards.append(list(map(int,input().split())))

min = cards[0][0]
max = cards[0][1]

for i in range(m):
    if cards[i][0] > min:
        min = cards[i][0]
    if cards[i][1] < max:
        max = cards[i][1]

if max >= min:
    print(max - min + 1)
else:
    print(0)
Problem p03085 (python)

Fixed submission:
b=input()
 
if b=="A":
    print("T")
elif b=="T":
    print("A")
elif b=="G":
    print("C")
elif b=="C":
    print("G")

Buggy submission (verdict: Runtime Error):
b=input()
 
if b="A":
    print("T")
elif b="T":
    print("A")
elif b="G":
    print("C")
elif b="C":
    print("G")

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

if b="A":
    print("T")
elif b="T":
    print("A")
elif b="G":
    print("C")
elif b="C":
    print("G")
Problem p03109 (python)

Fixed submission:
s=list(map(int,input().split("/")))
 
if s[0]<=2018:
  print("Heisei")
elif s[0]==2019 and s[1]<5:
  print("Heisei")
else:
  print("TBD")

Buggy submission (verdict: Runtime Error):
s=list(map(int,input().split("/")))
 
if s[0]<=2018:
  print("Heisei")
elif s[0]=2019 and s[1]<5:
  print("Heisei")
else:
  print("TBD")

Buggy submission (verdict: Runtime Error):
s=list(map(int,input().split("/")))
 
if s[0]<=2018:
  print(Heisei)
elif s[0]=2019 and s[1]<5:
  print(Heisei)
else:
  print(TBD)

Buggy submission (verdict: Runtime Error):
s=list(map(int,input().split()))
 
if s[0]<=2018:
  print(Heisei)
elif s[0]=2019 and s[1]<5:
  print(Heisei)
else:
  print(TBD)

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

if s[0]<=2018:
  print(Heisei)
elif s[0]=2019 and s[1]<5:
  print(Heisei)
else:
  print(TBD)
Problem p03110 (python)

Fixed submission:
n=int(input())
yr_m=[]
sum_m=0
for i in range(n):
    yr_m.append(list(map(str,input().split())))

for k in range(n):
    yr_m[k][0]=float(yr_m[k][0])

for j in range(n):
    if yr_m[j][1]=="BTC":
        yr_m[j][0]=yr_m[j][0]*380000.0
    sum_m=sum_m+yr_m[j][0]

print(sum_m)

Buggy submission (verdict: Runtime Error):
n=int(input())
yr_m=[]
sum_m=0
for i in range(n):
  yr_m.append(list(map(float,str,input().split())))
 
  
for j in range(n):
  if yr_m[j][1]=="BTC":
    yr_m[j][0]=yr_m[j][0]*380000.0
  sum_m=sum_m+yr_m[j][0]
 
print(sum_m)

Buggy submission (verdict: Runtime Error):
n=int(input())
yr_m=[]
sum_m=0
for i in range(n):
  yr_m.append(list(map(float,input().split())))

  
for j in range(n):
  if yr_m[j][1]=="BTC":
    yr_m[j][0]=yr_m[j][0]*380000.0
  sum_m=sum_m+yr_m[j][0]

print(sum_m)
Problem p02608 (python)

Fixed submission:
n=int(input())
z=0
N=[0]*10000
ans=0
ko=0
for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            ko=x**2+y**2+z**2+x*y+y*z+z*x
            if ko<=n:
                N[ko-1]+=1
            else:
                break
for i in range(n):
    print(N[i])

Buggy submission (verdict: Runtime Error):
n=int(input())
z=0
N=[0]*10000
ans=0
ko=0
for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            ko=x**2+y**2+z**2+x*y+y*z+z*x
            if ko<=n:
                N[ko]+=1
            else:
                break
for i in range(n):
    print(N[i])
Problem p02658 (python)

Fixed submission:
import numpy as np
n=int(input())
ans=1
a=input().split()
#print(a)
if '0' in a:
    ans=0
    print(ans)
if ans!=0:
    for i in a:
        ans=ans*int(i)
        if ans>10**18:
            ans=-1
            break
    print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
n=int(input())

a= list(map(float,input().split()))
def calc_double(n):
    return n / 10
a2 = list(map(calc_double,a))
#print(a2)

ans=np.prod(a2)*10**n

if ans>10**(18) or ans<0:
    ans=-1
print(int(ans))
Problem p02683 (python)

Fixed submission:
#Skill Up
n,m,x = map(int, input().split())

#ca = [map(int, input().split()) for _ in range(n)]
#ca = [input().split() for l in range(n)]
import sys
ca = [[int(c) for c in l.split()] for l in sys.stdin]
#c, a = [list(i) for i in zip(*ca)]
#print(ca)
#print(ca[0][0])
c=[]
for l in range(n):
    c.append(ca[l][0])
#print(c)

for l in range(n):
    del ca[l][0]
#print(ca)

INF = float('INF')
min_cost = INF
 
def dfs(i, cost, learn):
    if i == n:
        if min(learn) >= x:
            return cost
        else:
            return INF
    else:
        new_learn = [X + Y for (X, Y) in zip(ca[i], learn)]
        cost = min(dfs(i + 1, cost, learn), dfs(i + 1, cost + c[i], new_learn))
        return cost
 
min_cost = dfs(0, 0, [0] * m)
 
if min_cost == INF:
    print(-1)
else:
    print(min_cost)

Buggy submission (verdict: Runtime Error):
#Skill Up
n,m,x = map(int, input().split())

#ca = [map(int, input().split()) for _ in range(n)]
#ca = [input().split() for l in range(n)]
import sys
ca = [[int(c) for c in l.split()] for l in sys.stdin]
#c, a = [list(i) for i in zip(*ca)]
#print(ca)
#print(ca[0][0])
c=[]
a=[]
for l in range(n):
    c.append(ca[l][0])
#print(c)

for l in range(n):
    del ca[l][0]
#print(ca)
a=ca

INF = float('INF')
min_cost = INF
 
def dfs(i, cost, learn):
    if i == n:
        if min(learn) >= x:
            return cost
        else:
            return INF
    else:
        new_learn = [X + Y for (X, Y) in zip(a[i], learn)]
        cost = min(dfs(i + 1, cost, learn), dfs(i + 1, cost + C[i], new_learn))
        return cost
 
min_cost = dfs(0, 0, [0] * m)
 
if min_cost == INF:
    print(-1)
else:
    print(min_cost)
Problem p03433 (python)

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

print("Yes") if n%500<=a else print("No")

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

if N%500 =< A :
    print("YES")
else :
    print("NO")
Problem p03448 (python)

Fixed submission:
#Coins
A=int(input())
B=int(input())
C=int(input())
X=int(input())

i=0
#j=0 ここに入れるとだめ
ans=0
while i <=A:
    X_aftera=X-500*i
    if X_aftera<0:
        break
    j=0
    while j<=B:
        X_afterb=X_aftera-100*j
        if X_afterb<0:
            break
        if X_afterb//50<=C:
            ans +=1
        j+=1
    i+=1
print(ans)

Buggy submission (verdict: Runtime Error):
if all(X//500<=A X%500<=(100*B+50*C) (X%500)%100<=C*50):
    print
Problem p03478 (python)

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

s=0
for i in range(n+1):
    x = i
    m = 0
    while x:
        m += x % 10
        x //= 10
    if a <= m <= b:
        s += i
print(s)

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

s=0
for i in range(N+1):
    x = i
    m = 0
    while x:
        m += x % 10
        x //= 10
    if a <= m <= b:
        s += i
print(s)