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

Fixed submission:
import numpy as np
n,W=map(int,input().split())
wv=[list(map(int,input().split())) for i in range(n)]
wv=np.array(wv)
dp=[0]*(W+1)
dp=np.array(dp)
for w,v in wv:
  dp[w:]=np.maximum(dp[w:],dp[:-w]+v)
print(dp[W])

Buggy submission (verdict: Runtime Error):
import numpy as np
n,W=map(int,input().split()
wv=[list(map(int,input().split())) for i in range(n)]
wv=np.array(wv)
dp=[0]*(W+1)
dp=np.array(dp)
for w,v in wv:
  dp[w:]=np.maximum(dp[w:],dp[:-w]+v)
print(dp[W])

Buggy submission (verdict: Runtime Error):
impport numpy as np
n,w=map(int,input())
wv=list(map(int,input().split()))
wv=np.array(wv)
dp=[0]*(w+1)
dp=np.array(dp)
for w,v in wv:
  dp[w:]=max(dp[w:],dp[:-w]+v)
print(dp[w])

Buggy submission (verdict: Runtime Error):
n,w=map(int,input().split())
l=[list(map(int,input().split())) for i in range(n)]
dp=[[0 for j in range(w+1)] for i in range(n+1)]
for i in range(n):
  for j in range(w+1):
    dp[i+1][j]=max(dp[i][j],dp[i][j-l[i][o]]+l[i][1])
print(dp[n][w])
Problem p03165 (python)

Fixed submission:
s=input()
t=input()
n=len(s)
m=len(t)
dp=[[0 for i in range(m+1)] for j in range(n+1)]
for i in range(n):
  for j in range(m):
    if s[i]==t[j]:
      dp[i+1][j+1]=dp[i][j]+1
    else:
      dp[i+1][j+1]=max(dp[i][j+1],dp[i+1][j])
ans=''
a=n
b=m
while a>0 and b>0:
  if dp[a][b]==dp[a-1][b]:
    a-=1
  elif dp[a][b]==dp[a][b-1]:
    b-=1
  else:
    a-=1
    b-=1
    ans=s[a]+ans
print(ans)

Buggy submission (verdict: Runtime Error):
s=input()
t=input()
n=len(s)
m=len(t)
dp=[[0 for i in range(n+1)] for j in range(m+1)]
for i in range(n):
  for j in range(m):
    if s[i]==t[j]:
      dp[i+1][j+1]=dp[i][j]+1
    else:
      dp[i+1][j+1]=max(dp[i][j+1],dp[i+1][j])
l=dp[n][m]
ans=''
a=n
b=m
while a>0 and b>0:
  if dp[a][b]==dp[a-1][b]:
    a-=1
  elif dp[a][b]==dp[a][b-1]:
    b-=1
  else:
    a-=1
    b-=1
    ans=s[a]+ans
print(ans)
Problem p03211 (python)

Fixed submission:
s=input()
n=len(s)
list=[]
for i in range(n-2):
  list.append(''.join(s[i:i+3]))
ans=[]
for l in list:
  ans.append(abs(int(l)-753))
print(min(ans))

Buggy submission (verdict: Runtime Error):
s=input()
n=len(input())
list=[]
for i in range(n-2):
  list.append(int(list[i:i+3]))
ans=[]
for l in list:
  ans.append(abs(l-753))
print(min(ans))
Problem p03220 (python)

Fixed submission:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
list=[]
for hh in h:
  list.append(t-0.006*hh)
ans=[]
for l in list:
  ans.append(abs(a-l))
print(ans.index(min(ans))+1)

Buggy submission (verdict: Runtime Error):
n=int(input())
n,a=map(int,input().split())
h=list(map(int,input().split()))
list=[]
for hh in h:
  list.append(t-0.006*hh)
ans=[]
for l in list:
  ans.append(abs(a-l))
print(min(ans))
Problem p03239 (python)

Fixed submission:
N,T=map(int,input().split())
lists=[list(map(int,input().split())) for x in range(N)]
ans=[]
for list in lists:
  if list[1]<=T:
    ans.append(list)
if len(ans)==0:
  print('TLE')
else:
  ans.sort(key=lambda x:x[0])
  print(ans[0][0])

Buggy submission (verdict: Runtime Error):
N,T=map(int,input().split())
lists=[list(map(int,input().split())) for x in range(N)]
ans=[]
for list in lists:
  if list[1]<=T:
    ans.append(list)
ans.sort(key=lambda x:x[0])
print(ans[0][0])
Problem p03240 (python)

Fixed submission:
n=int(input())
xyh=[list(map(int,input().split())) for i in range(n)]
xyh.sort(key=lambda f:f[2])
p=xyh[-1]
for cx in range(0,101):
  for cy in range(0,101):
    h=p[2]+abs(p[0]-cx)+abs(p[1]-cy)
    for u in xyh:
      if u[2]!=max(0,h-abs(u[0]-cx)-abs(u[1]-cy)):
        break
    else:
      print(cx,cy,h)

Buggy submission (verdict: Runtime Error):
import collections
n=int(input())
xyh=[list(map(int,input().split())) for i in range(n)]
xyh.sort()
p=xyh[-1]
q=xyh[-2]
for cx in range(0,101):
    for cy in range(0,101):
      if abs(p[0]-cx)+abs(p[1]-cy)==abs(q[0]-cx)+abs(q[1]-cy)+p[2]-q[2]:
        ax=cx
        ay=cy
H=p[2]+abs(p[0]-ax)+abs(p[1]-ay)
print(ax,ay,H)
Problem p03241 (python)

Fixed submission:
n,m=map(int,input().split())
a=m//n
while True:
  if m/a==int(m/a):
    print(a)
    exit()
  a-=1

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=m//n
while True:
  if m/a=int(m/a):
    print(a)
    exit()
  a-=1
Problem p03274 (python)

Fixed submission:
n,k=map(int,input().split())
l=list(map(int,input().split()))
ans=[]
for i in range(n-k+1):
  ans.append(min(abs(l[i])+abs(l[i]-l[i+k-1]),abs(l[i+k-1])+abs(l[i+k-1]-l[i])))
print(min(ans))

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
l=list(map(int,input().split()))
ans=[]
for i in range(n-k+1):
  ans.append(min(abs(l[i])+abs([l[i]-l[i+k-1]),abs(l[i+k-1])+abs(l[i+k-1]-l[i])))
print(min(ans))
Problem p03283 (python)

Fixed submission:
n,m,qu=map(int,input().split())
ans=[[0]*(n+1) for __ in range(n+1)]
for _ in range(m):
  l,r=map(int,input().split())
  ans[l][r]+=1
for i in range(n+1):
  for j in range(n):
    ans[i][j+1]+=ans[i][j]
for i in range(n):
  for j in range(n+1):
    ans[i+1][j]+=ans[i][j]
for qq in range(qu):
  p,q=map(int,input().split())
  print(ans[q][q]-ans[p-1][q]-ans[q][p-1]+ans[p-1][p-1])

Buggy submission (verdict: Runtime Error):
n,m,q=map(int,input().split())
ans=[[0]*(n+1) for __ in range(n+1)]
for _ in range(m):
  l,r=map(int,input().split())
  ans[l][r]+=1
for i in range(n+1):
  for j in range(n):
    ans[i][j+1]+=ans[i][j]
for i in range(n):
  for j in range(n+1):
    ans[i+1][j]+=ans[i][j]
for qq in q:
  p,q=map(int,input().split())
  print(ans[q][q]-ans[p-1][q]-ans[p][q-1]+ans[p][p])
Problem p03325 (python)

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
cnt=0
for i in range(n):
  c=0
  while l[i]%2==0:
    l[i]=l[i]//2
    c+=1
  cnt+=c
print(cnt)

Buggy submission (verdict: Runtime Error):
n=int(input())
l=list(map(int,input().split()))
cnt=0
for i in range(n):
  c=0
  while l[i]%2==0:
    l[i]=l[i]//2
      c+=1
  cnt+=c
print(cnt)
Problem p03353 (python)

Fixed submission:
s=input()
n=len(s)
k=int(input())
l=[]
for i in range(n):
  for j in range(i,i+k+1):
    a=s[i:j+1]
    l.append(a)
l=set(l)
l=list(l)
l.sort()
print(l[k-1])

Buggy submission (verdict: Runtime Error):
s=input()
k=int(input())
l=[]
for i in range(n):
  for j in range(i:n):
    a=s[i:j+1]
    l.append(a)
l=set(l)
l.sort()
print(l[k-1])
Problem p03354 (python)

Fixed submission:
n,m=map(int,input().split())
f=lambda x:int(x)-1
p=list(map(f,input().split()))
par=[j for j in range(n)]
def find(x):
  if x==par[x]:
    return x
  else:
    par[x]=find(par[x])
    return par[x]
 
def union(a,b):
  ra=find(a)
  rb=find(b)
  if ra!=rb:
    par[ra]=rb
 
for i in range(m):
  v,w=map(f,input().split())
  union(v,w)
 
ans=0
for j in range(n):
  if find(j)==find(p[j]):
    ans+=1
print(ans)

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

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

def union(x,y):
  fx=find(x)
  fy=find(y)
  if fx!=fy:
    par[fx]=fy

f=lambda x:int(x)-1
for mm in range(m):
  x,y=map(f,input().split())
  union(x,y)

ans=0
for i in range(n):
  if find(p[i])==i:
    ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
f=lambda x:int(x)-1
p=list(map(f,input().split()))
par=[j for j in range(n)]
def find(x):
  if x==par[x]:
    return x
  else:
    par[x]=find(par[x])
    return par[x]
 
def union(a,b):
  ra=find(a)
  rb=find(b)
  if ra!=rb:
    par[ra]=par[ry]
 
for i in range(m):
  v,w=map(f,input().split())
  union(v,w)
 
ans=0
for j in range(n):
  if find(j)==find(p[j]):
    ans+=1
print(ans)
Problem p03361 (python)

Fixed submission:
h,w=map(int,input().split())
d=[['.']*(w+2) for j in range(h+2)]
for hh in range(h):
  moji=input()
  for ww in range(w):
    d[hh+1][ww+1]=moji[ww]
for k in range(1,h+1):
  for l in range(1,w+1):
    if d[k][l]=='#' and all(aa=='.' for aa in [d[k-1][l],d[k+1][l],d[k][l-1],d[k][l+1]]):
      print('No')
      exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
h,w=map(int,input().split())
d=[['.']*(n+2) for j in range(n+2)]
for i in range(n):
  s,t=map(int,input().split())
  d[s][t]='#'
for k in range(1,n+1):
  for l in range(1,n+1):
    if all(aa=='.' or aa in [d[k-1][l],d[k+1][l],d[k][l-1],d[k][l+1]]):
      print('No')
      exit()
print('Yes')
Problem p03401 (python)

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
l.insert(0,0)
l.append(0)
wa=0
for i in range(n+1):
  wa+=abs(l[i+1]-l[i])

  
for j in range(n):  
  if abs(l[j+2]-l[j])<abs(l[j+1]-l[j])+abs(l[j+2]-l[j+1]):
    if abs(l[j+1]-l[j])<abs(l[j+2]-l[j+1]):
      print(wa-2*abs(l[j+1]-l[j]))
    else:
      print(wa-2*abs(l[j+2]-l[j+1]))
  else:
    print(wa)

Buggy submission (verdict: Runtime Error):
n=int(input())
l=list(map(int,input().split()))
l.insert(0,0)
wa=0
for i in range(n):
  wa+=abs(l[i+1]-l[i])
for i in range(1,n+1):
  print(wa-l[i]-l[i+1])
Problem p03409 (python)

Fixed submission:
n=int(input())
red=[list(map(int,input().split())) for _ in range(n)]
blue=[list(map(int,input().split())) for _ in range(n)]
red.sort()
blue.sort()
 
p=0
for bb in blue:
  lis=[-1,-1]
  for rr in red:
    if rr[0]<bb[0] and rr[1]<bb[1] and lis[1]<rr[1]:
      lis=rr
  if lis!=[-1,-1]:
    red.remove(lis)
    p+=1
print(p)

Buggy submission (verdict: Runtime Error):
n=int(input())
red=[list(map(int,input().split())) for _ in range(n)]
blue=[list(map(int,input().split())) for _ in range(n)]
red.sort()
blue.sort()
 
p=0
for bb in blue:
  lis=[-1,-1]
  for rr in red:
    if rr[0]<bb[0] and rr[1]<bb[1] and lis[1]<rr[1]:
      lis=rr
    if lis!=[-1,-1]:
      red.remove(lis)
      p+=1
print(p)
Problem p03435 (python)

Fixed submission:
l=[list(map(int,input().split())) for i in range(3)]
x=l[0][0]
y=l[0][1]
z=l[0][2]
a=0
b=l[1][0]-x
c=l[2][0]-x
if b+y==l[1][1] and b+z==l[1][2] and c+y==l[2][1] and c+z==l[2][2]:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
l=[list(map(int,input().split())) for i in range(3)]
x=l[0][0],y=l[0][1],z=l[0][2]
a=0,b=l[1][0]-x,c=l[2][0]-x
if b+y==l[1][1] and b+z==l[1][2] and c+y==l[2][1] and c+z==l[2][2]:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
ll=[list(map(int,input().split())) for i in range(3)]
for i in range(2):
  for j in range(i+1,3):
    for k in range(3):
      if ll[k][i]==ll[k][j]:
          if not all(ll[t][i]==ll[t][j] for t in range(3)):
            print('No')
            exit()
      if ll[i][k]==ll[j][k]:
        if not all(ll[i][t]==ll[j][t] for t in range(3)):
          print('No')
          exit()
su=0
for lll in ll:
  s=sum(lll)
  su+=s
if su%3!=0:
  print('No')
else:

Buggy submission (verdict: Runtime Error):
ll=[list(map(int,input().split())) for i in range(3)]
for i in range(2):
  for j in range(i+1,3):
    for k in range(3):
      if ll[k][i]==ll[k][j]:
          if not all(ll[t][i]==ll[t][j] for t in range(3)):
            print('No')
            exit()
      if ll[i][k]==ll[j][k]:
        if not all(ll[i][t]==ll[j][t] for t in range(3)):
          print('No')
          exit()
s=0
for lll in ll:
  s=sum(lll)
  su+=s
if su%3!=0:
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
su=0
for i in range(3):
  l=list(map(int,input().split()))
  s=sum(l)
  su+=s
if su%3!=0:
  print('No')
  exit()
ll=[list(map(int,input().split())) for i in range(3)]
for i in range(2):
  for j in range(i+1,3):
    for k in range(3):
       if ll[k][i]==ll[k][j]:
          if not all(ll[t][i]==ll[t][j] for t in range(3)):
            print('No')
            exit()
        if ll[i][k]==ll[j][i]:
          if not all(ll[i][t]==ll[j][t] for t in range(3)):
            print('No')
            exit()
       
print('Yes')
Problem p03448 (python)

Fixed submission:
A,B,C,x=[int(input()) for _ in range(4)]
a=x//500
b=x//100
c=x//50
ans=0
for s in range(0,a+1):
  for t in range(0,b+1):
    u=(x-500*s-100*t)//50
    if all([0<=s<=A,0<=t<=B,0<=u<=C]):
      ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
A,B,C,x=[int(input()) for _ in range(4)]
a=x//500
b=x//100
c=x//50
ans=0
for s in range(1,a+1):
  for t in range(1+b+1):
    u=(x-500*s-100*t)//50
    if all(0<=s<=A and 0<=t<=B and 0<=u<=C):
      ans+=1
print(ans)
Problem p03494 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
ans=0
while all(aa%2==0 for aa in a):
  ans+=1
  a=[aa//2 for aa in a]
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
n=0
while n>=0:
  if all(aa%2==0):
    for b in a:
      b=b//2
    n+=1
  else:
    break
print(n)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
n=0
while n>=0:
  if all(aa%2==0 for aa in a):
    aa%=2
    n+=1
  else:
    break
print(n)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
n=0
if all(aa%2==0 for aa in a):
  aa%=2
  n+=1
print(n)
Problem p02555 (python)

Fixed submission:
import math


def main():
    s = int(input())
    quo = int(s/3)
    count = 0

    for i in range(1, quo+1):
        a = math.factorial((s-3*i)+(i-1))
        b = math.factorial(s-3*i)
        c = math.factorial(i-1)
        add = a//(b*c)
        count += add

    return count % (10**9+7)


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

Buggy submission (verdict: Runtime Error):
import math


def main():
    s = int(input())
    quo = int(s/3)
    count = 0

    for i in range(1, quo+1):
        a = math.factorial((s-3*i)+(i-1))
        b = math.factorial(s-3*i)
        c = math.factorial(i-1)
        add = int(a/(b*c))
        count += add

    return count % (10**9+7)


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

Buggy submission (verdict: Runtime Error):
import math


def main():
    s = int(input())
    quo = int(s/3)
    count = 0

    for i in range(1, quo+1):
        a = int(math.factorial((s-3*i)+(i-1)))
        b = int(math.factorial(s-3*i))
        c = int(math.factorial(i-1))
        add = int(a/(b*c))
        count += add

    return int(count % (10**9+7))


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

Fixed submission:
N = int(input())

R = ["AC", "WA", "TLE", "RE"]
C = [0, 0, 0, 0]

for i in range(N):
    S = input()
    if S == R[0]:
        C[0] += 1
    elif S == R[1]:
        C[1] += 1
    elif S == R[2]:
        C[2] += 1
    elif S == R[3]:
        C[3] += 1

for i in range(len(C)):
    print(R[i], "x", C[i])

Buggy submission (verdict: Runtime Error):
N = int(input())
s = [input() for v in range(N)]
for v in ["AC", "WA", "TLE", "RE"]
    print("{0} x {1}".format(v, s.count(v)))
Problem p02706 (python)

Fixed submission:
N,M = map(int,input().split())    
A = list(map(int, input().split())) 
S = 0
for i in range(M):
  S += A[i]
F = N-S
if F>=0:
  print(F)
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
N,M = int(input())
A = list(map(int, input().split())) 
S = 0
for i in M:
  S += A[i]
print (N-S)
Problem p02921 (python)

Fixed submission:
A = str(input())
B = str(input())
C = 0
for i in range(3):
  if A[i] == B[i]:
    C += 1
print(C)

Buggy submission (verdict: Runtime Error):
A = str(input())
B = str(input())
C = 0
for i in range(3):
  if A[i] == B[i]:
    C += 0
print(c)
Problem p03238 (python)

Fixed submission:
#!/Library/Frameworks/Python.framework/Versions/3.5/bin/python3
from collections import defaultdict

n = input()
if n == '1':
    print('Hello World')
else:
    a = int(input())
    b = int(input())
    print(a + b)

Buggy submission (verdict: Runtime Error):
#!/Library/Frameworks/Python.framework/Versions/3.5/bin/python3

n = int(input())
vh = {}
zx = []
zy = []
zh = []
for j in range(101):
    for k in range(101):
        vh[j, k] = -2
for i in range(n):
    x, y, h = list(map(int, input().split()))
    if h == 0:
        zx.append(x)
        zy.append(y)
        zh.append(h)
        continue
    for j in range(101):
        for k in range(101):
            hi = h + abs(j - x) + abs(k - y)
            if vh[j, k] == -2:
                vh[j, k] = hi
            elif vh[j, k] > -1:
                if vh[j, k] != hi:
                    vh[j, k] = -1

rs = 0
for j in range(101):
    for k in range(101):
        if vh[j, k] > -1:
            rs += 1
            rj = j
            rk = k

if rs == 1:
    print(rj, rk, vh[rj, rk])
else:
    for i in range(rs):
        dels = 0
        for j in range(101):
            for k in range(101):
                hi = zh + abs(j - zx) + abs(k - zy)
                if vh[j, k] > -1:
                    if vh[j, k] != hi:
                        dels += 1
        if dels == rs - 1:
            for j in range(101):
                for k in range(101):
                    hi = zh + abs(j - zx) + abs(k - zy)
                    if vh[j, k] > -1:
                        if vh[j, k] != hi:
                            vh[j, k] = -1
            for j in range(101):
                for k in range(101):
                    if vh[j, k] > -1:
                        print(j, k, vh[j, k])
Problem p03324 (python)

Fixed submission:
#!/Library/Frameworks/Python.framework/Versions/3.5/bin/python3

d, n = map(int, input().split())

a = 0
if d == 0:
    a = n
    if n == 100:
        a += 1
elif d == 1:
    a = 100 * n
    if n == 100:
        a += 100
elif d == 2:
    a = 100 * 100 * n
    if n == 100:
        a += 100 * 100

print(a)

Buggy submission (verdict: Runtime Error):
#!/Library/Frameworks/Python.framework/Versions/3.5/bin/python3

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

t = 0
for i in a:
    m = i
    while m % 2 == 0:
        t += 1
        m /= 2

print(t)
Problem p03361 (python)

Fixed submission:
#!/usr/bin/python3

h, w = map(int, input().split())
s = [input() for i in range(h)]

ns = ((0, -1), (-1, 0), (0, 1), (1, 0))
for i in range(h):
    for j in range(w):
        if s[i][j] != '#':
            continue
        for dx, dy in ns:
            nx = j + dx
            ny = i + dy
            if 0 <= nx < w and 0 <= ny < h:
                if s[ny][nx] == '#':
                    break
        else:
            print('No')
            exit()

print('Yes')

Buggy submission (verdict: Runtime Error):
h, w = map(int, input().split())
s = [input() for i in range(h)]

ns = ((0, -1), (-1, 0), (0, 1), (1, 0))
for i in range(h):
    for j in range(w):
        if s[i][j] != '#':
            continue
        for dx, dy in ns:
            nx = i + dx
            ny = j + dy
            if nx < 0 or nx >= w:
                continue
            if ny < 0 or ny >= h:
                continue
            if s[nx][ny] == '#':
                break
        else:
            print('No')
            exit()

print('Yes')
Problem p02548 (python)

Fixed submission:
n = int(input())
count = ((n-1) * 2) -1

for i in range(2,n):
  if(i*2 >= n):
    break
  for j in range(2,n):
    if(i*j < n):
      count += 1
    else:
      break
    
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
count = 0

for i in range(1,n):
  for j in range(1,n):
    if(a*b < n):
      count += 1
      
print(count)
Problem p02658 (python)

Fixed submission:
n = int( input() )
A = list( map( int,input().split() ) )
 
if 0 in A:
  print( 0 )
else:
  ret = 1
  for a in A:
    ret = ret * a
    if ret > 10 ** 18:
      ret = -1
      break
  print( ret )

Buggy submission (verdict: Runtime Error):
n = int(input())
frag = 10**9
a = list(map(float, input().split()))

for i in range(n):
  a[i] = a[i]/float(frag)
  
ans = 1

for i in range(n):
  ans = ans * a[i]

for i in range(n):  
	ans = ans * float(frag)
    
    
if(ans > 10**18):
    ans = -1

print(int(ans))

Buggy submission (verdict: Runtime Error):
a = list(map(float, input().split()))

for i in range(n):
  a[i] = a[i]/float(frag)
  
ans = 1

for i in range(n):
  ans = ans * a[i]

for i in range(n):  
	ans = ans * float(frag)
    
    
if(ans > 10**18):
    ans = -1

print(int(ans))
Problem p03469 (python)

Fixed submission:
date = input()

date_list = list(date)
date_list[3] = '8'
output = ''.join(date_list)

print(output)

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

for j in range(N+1):
    for i in range(N+1):
        sum = 10000*j + 5000*i + 1000*(N-i-j)
        if(sum==Y and N-i-j>=0):
            print(j,i,N-i-j)
            exit()
            
print('-1 -1 -1')

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

answer = []
comb = []
for j in range(N+1):
    for i in range(N+1):
        sum = 10000*j + 5000*i + 1000*(N-i-j)
        if(sum==Y and N-i-j>=0):
            print(j,i,N-i-j)
            exit()
            
print('-1 -1 -1')

Buggy submission (verdict: Runtime Error):
answer = []
comb = []
for j in range(N+1):
    for i in range(N+1):
        sum = 10000*j + 5000*i + 1000*(N-i-j)
        if(sum==Y and N-i-j>=0):
            comb = [j,i,N-i-j]
            answer = [str(x) for x in comb]
            answer = ' '.join(answer)
            print(answer)
            exit()
if not(answer):
    print('-1 -1 -1')
Problem p03471 (python)

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

for j in range(N+1):
    for i in range(N+1):
        sum = 10000*j + 5000*i + 1000*(N-i-j)
        if(sum==Y and N-i-j>=0):
            print(j,i,N-i-j)
            exit()
            
print('-1 -1 -1')

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

answer = []
comb = []
for j in range(N+1):
    for i in range(N+1):
        sum = 10000*j + 5000*i + 1000*(N-i-j)
        if(sum==Y and N-i-j>=0):
            print(j,i,N-i-j)
            exit()
            
print('-1 -1 -1')

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

answer = []
comb = []
for j in range(N+1):
    for i in range(N+1):
        sum = 10000*j + 5000*i + 1000*(N-i-j)
        if(sum==Y and N-i-j>=0):
            comb = [j,i,N-i-j]
            answer = [str(x) for x in comb]
            answer = ' '.join(answer)
            print(answer)
if not(answer):
    print('-1 -1 -1')
Problem p02602 (python)

Fixed submission:
N, K = map(int, input().split())
A = [int(x) for x in input().split()]

for i in range(N-K):
  t = A[i+K]/A[i]
  if t > 1:
    print("Yes")
  else:
    print("No")

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

N, K = map(int, input().split())
A = [int(x) for x in input().split()]

A_past = np.prod(A[:K])

for i in range(N-K):
  A_now = A_past*A[i+K]/A[i]
  if A_now > A_past:
    print("Yes")
  else:
    print("No")
  A_past = A_now
Problem p03455 (python)

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

if (a * b % 2 == 0):
    print('Even')
else:
    print('Odd')

Buggy submission (verdict: Runtime Error):
if (a * b & 1 == 1):
    print('Odd')
else:
    print('Even')
Problem p04045 (python)

Fixed submission:
def is_bad_nums(j: int, d: []) -> bool:
    while j:
        if j % 10 in d:
            return True
        j //= 10
    return False


def answer(n: int, k: int, d: []) -> int:
    for i in range(n, 100000):
        if is_bad_nums(i, d):
            continue
        return i


def main():
    n, k = map(int, input().split())
    d = list(map(int, input().split()))
    print(answer(n, k, d))


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def answer(n: int, k: int, d: []) -> int:
    numbers = list({0, 1, 2, 3, 4, 5, 6, 7, 8, 9} ^ set(d))
    payment = ''
    for i in str(n):
        for num in numbers:
            if int(i) <= num:
                payment += str(num)
                break
    return int(payment)


def main():
    n, k = map(int, input().split())
    d = map(int, input().split())
    print(answer(n, k, d))


if __name__ == '__main__':
    main()