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

Fixed submission:
n, m = map(int, input().split())
A, B = [0]*n, [0]*n
ans = 'IMPOSSIBLE'
for i in range(m):
    a, b = map(int, input().split())
    if a == 1:
        A[b-1] += 1
    if b == n:
        B[a-1] += 1
if sum(B) == 0:
    print(ans)
    exit()
else:
    for i in range(n):
        if A[i] == 1 and B[i] == 1:
            ans = 'POSSIBLE'
            break
    print(ans)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
A, B = [0]*n, [0]*n
ans = 'IMPOSSIBLE'
for i in range(m):
    a, b = map(int, input().split())
    if a == 1:
        A[b-1] += 1
    if b == n:
        B[a-1] += 1

for i in range(m):
    if A[i] == 1 and B[i] == 1:
        ans = 'POSSIBLE'
        break
print(ans)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
A, B = [0]*n, [0]*n
ans = 'IMPOSSIBLE'
for i in range(m):
    a, b = map(int, input().split())
    if a == 1:
        A[b-1] += 1
    if b == n:
        B[a-1] += 1

if sum(B) == 0:
    print(ans)
    exit()
else:
    for i in range(m):
        if A[i] == 1 and B[i] == 1:
            ans = 'POSSIBLE'
            break
print(ans)
Problem p03680 (python)

Fixed submission:
n = int(input())
a = [int(input()) for _ in range(n)]
now = a[0]
c = 1

if now == 2:
    print(1)
    exit()

for i in range(n):
    now = a[now-1]
    c += 1
    if now == 2:
        print(c)
        exit()
print(-1)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for _ in range(n)]
button = [0]*n
button1 = a[0] - 1
try:
    a.remove(2)
    print('01')
    exit()
except:
    pass
count = 1
while True:
    button[button1] += 1
    button1 = a[button1] - 1
    if button[1] == 1:
        print(count)
        break
    try:
        button.remove(2)
        print('-1')
        break
    except:
        count += 1
        pass
Problem p03720 (python)

Fixed submission:
n, m = map(int, input().split())
result = [0 for _ in range(n)]
for i in range(m):
    a, b = map(int, input().split())
    result[a-1] += 1
    result[b-1] += 1

for j in result:
    print(j)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
result = [0 for _ in range(m)]
for i in range(m):
    a, b = map(int, input().split())
    result[a-1] += 1
    result[b-1] += 1

for j in result:
    print(j)
Problem p02613 (python)

Fixed submission:
n=int(input())
ac=0
wa=0
tle=0
re=0
for i in range(n):
  num=str(input())
  if num=="AC":
    ac+=1
  elif num=="WA":
    wa+=1
  elif num=="TLE":
    tle+=1
  else:
    re+=1
    
print("AC x {}".format(ac))
print("WA x {}".format(wa))
print("TLE x {}".format(tle))
print("RE x {}".format(re))

Buggy submission (verdict: Runtime Error):
n=int(input())
ac=0
wa=0
tle=0
re=0

for i in range(n):
  num=str(input())
  if num=="AC":
    ac+=1
  elif num=="WA":
    wa+=1
  elif num=="TLE":
    tle+=1
  else num=="RE":
    re+=1
    
print("AC × {}".format(ac))
print("WA × {}".format(wa))
print("TLE × {}".format(tle))
print("RE × {}".format(re))

Buggy submission (verdict: Runtime Error):
n=int(input())
ac=0
wa=0
tle=0
re=0

for i in range(n):
  num=str(input())
  if num=="AC":
    ac+=1
  elif num=="WA":
    wa+=1
  elif num=="TLE":
    tle+=1
  else num=="RE":
    re+=1
   

print("AC × {}".format(ac)
print("WA × {}".format(wa)
print("TLE × {}".format(tle)
print("RE × {}".format(re)

Buggy submission (verdict: Runtime Error):
n=int(input())
ac=0
wa=0
tle=0
re=0
for i in range(n):
  num=str(input())
  if num=="AC":
    ac+=1
  elif num=="WA":
    wa+=1
  elif num=="TLE":
    tle+=1
  else num=="RE":
    re+=1
   

print("AC ×"{}.format(ac)
print("WA ×"{}.format(wa)
print("TLE ×"{}.format(tle)
print("RE ×"{}.format(re)
Problem p02628 (python)

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

ans=0
for i in range(k):
  mi=min(lis)
  ans+=mi
  lis.remove(mi)
  
print(ans)

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

ans=0
for i in range(k):
  mi=min(lis)
  ans+=mi
  lis.remove(mi)
  
print(ans)
Problem p02639 (python)

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

print(lis.index(0)+1)

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

count=0
for i in l:
  for j in l:
    if i%j==0:
      if i!=j:
        count+=1
        break
      
print(n-count)

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

print(lis.index(0)+1)
Problem p02645 (python)

Fixed submission:
a=input()
print(a[0:3])

Buggy submission (verdict: Runtime Error):
a=map(str, input())
print(a[0:3])
Problem p02646 (python)

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

ans="NO"
if v>w:
  f=v-w
  hoge=abs(a-b)
  if f*t>=hoge:
    ans="YES"
    
print(ans)

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

ans="NO"
if v>w:
  f=v-w
  hoge=hoge(a-b)
  if f*t>=hoge:
    ans="YES"
    
print(ans)
Problem p02658 (python)

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

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

ans=1
if 0 in x:
  print(0)
  break
  for i in x:
    ans=ans*i  
if ans>=1000000000000000000:
  ans=-1
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
x=list(int(input().split())
 
ans = 1
for i in x:
  ans = ans*i
  
if ans > 1000000000000000000:
  ans = -1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
x = [int(input().split()) for i in range(n)]
 
ans = 1
for i in x:
  ans = ans*i
  
if ans > 1000000000000000000:
  ans = -1
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
x=[int(input()) for i in range(n)]
 
ans=1
for i in x:
  ans = ans*i
  
if ans > 1000000000000000000:
  ans=-1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
x = [int(input()) for i in range(n)]

ans = 1
for i in x:
  ans = ans*i
  
if ans > 1000000000000000000:
  ans = -1

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
x = [input() for i in range(n)]

ans = 1
for i in x:
  ans = ans*i
  
if ans > 1000000000000000000:
  ans = -1

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(inut())
x = [input() for i in range(n)]

ans = 1
for i in x:
  ans = ans*i
  
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(inut())
x = [input() for i in range(n)]

ans = 1
for i in x:
  ans*i
  
print(ans)
Problem p02760 (python)

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

n=int(input())

ans_list=[False]*9

for i in range(n):
  num=int(input())
  if num in l:
    index=l.index(num)
    ans_list[index]=True
    
if ans_list[0] and ans_list[1] and ans_list[2]:
  print("Yes")
elif ans_list[0] and ans_list[3] and ans_list[6]:
  print("Yes")
elif ans_list[3] and ans_list[4] and ans_list[5]:
  print("Yes")
elif ans_list[6] and ans_list[7] and ans_list[8]:
  print("Yes")
elif ans_list[1] and ans_list[4] and ans_list[7]:
  print("Yes")
elif ans_list[2] and ans_list[5] and ans_list[8]:
  print("Yes")
elif ans_list[0] and ans_list[4] and ans_list[8]:
  print("Yes")
elif ans_list[2] and ans_list[4] and ans_list[6]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
l=list(map(int,imput().split()))
l+=list(map(int,imput().split()))
l+=list(map(int,imput().split()))

n=int(input())

ans_list=[False]*9

for i in range(n):
  num=int(input())
  if num in l:
    index=l.index(num)
    ans_list[index]=True
    
if ans_list[0] and ans_list[1] and ans_list[2]:
  print("Yes")
elif ans_list[0] and ans_list[3] and ans_list[6]:
  print("Yes")
elif ans_list[3] and ans_list[4] and ans_list[5]:
  print("Yes")
elif ans_list[6] and ans_list[7] and ans_list[8]:
  print("Yes")
elif ans_list[1] and ans_list[4] and ans_list[7]:
  print("Yes")
elif ans_list[2] and ans_list[5] and ans_list[8]:
  print("Yes")
elif ans_list[0] and ans_list[4] and ans_list[8]:
  print("Yes")
elif ans_list[2] and ans_list[4] and ans_list[6]:
  print("Yes")
else:
  print("No")
Problem p02761 (python)

Fixed submission:
N,M = map(int,input().split())
a = [-1]*N
ans = 0
for i in range(M):
    s,c = map(int,input().split())
    if a[s-1] == -1:
        a[s-1] = c
    elif a[s-1] != c:
        ans = -1
        break
if a[0] == 0 and N>1:
    ans = -1
if ans != -1:
    if a[0] == -1 and N>1:
        a[0] = 1
    if a[0] == -1 and N == 1:
        a[0] = 0
    for i in range(N):
        if a[i] == -1:
            a[i] = 0
        a[i] = str(a[i])
    ans = "".join(a)
print(ans)

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

num=[-1]*n

for i in l:
  if num[i[0]-1]==-1 or num[i[0]-1]==i[1]:
    num[i[0]-1]=i[1]
  elif i[0]==1 and i[1]==0 and n==1:
    print(0)
    exit()
  else:
    print(-1)
    exit()
    
if num[0]==0:
  print(-1)
elif n=1 and num[0]==-1:
  print(0)
else:
  for i in range(len(num)):
    if num[i]==-1 and i==0:
      num[i]=1
    elif num[i]==-1:
      num[i]=0
    
  print(*num,sep='')
Problem p02780 (python)

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

for i in range(n):
  l[i]=(l[i]+1)/2

lis=[0]*(n+1)
for i in range(n):
  lis[i+1]=lis[i]+l[i]
  
ans=0
for i in range(n-k+1):
  num=lis[i+k]-lis[i]
  ans=max(num,ans)
  
print(ans)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
l=sorted(list(map(int,input().split())),reversed=True)

l=l[0:k]
max_l=max(l)

num=0
sum_lis=[]
for i in range(1,max_l+1):
  num+=i
  sum_lis.append(num)
  
ans=0
for i in l:
  a=sum_lis[i-1]
  ans+=(a/i)
  
print(ans)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
l=sorted(list(map(int,input().split())),reversed=True)

l=l[0:k]
max_l=max(l)

num=0
sum_lis=[]
for i in range(1,max_l+1):
  num+=i
  sum_lis.append(num)
  
ans=0
for i in l:
  a=sum_lis[i-1]
  ans+=(a/i)
  print(ans,i,a)
  
print(ans)
Problem p02911 (python)

Fixed submission:
from collections import Counter

n,k,q=map(int,input().split())
l=[int(input()) for i in range(q)]

l_c=Counter(l)

for i in range(1,n+1):
  ok=l_c[i]
  num=k-q+ok
  if num>0:
    print("Yes")
  else:
    print("No")

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

for i in range(1,n+1):
  ans=k
  for j in range(q):
    que=int(input())
    if que!=i:
      ans-=1
    if ans<=0:
      break
  if ans<=0:
    print("No")
  else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
n,k,q=map(int,input().split())
l=[int(input().split()) for i in range(q)]

for i in range(1,n+1):
  ans=k
  for que in l:
    if que!=i:
      ans-=1
  if ans<=0:
    print("No")
  else:
    print("Yes")

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

for i in range(1,n+1):
  ans=k
  for j in range(q):
    que=int(input())
    if que!=i:
      ans-=1
  if ans<=0:
    print("No")
  else:
    print("Yes")
Problem p02922 (python)

Fixed submission:
a,b=map(int,input().split())
 
n=0
while (a-1)*n+1 < b:
  n+=1
  
print(n)

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

n=1
while (a-1)n+1 <= b:
  n+=1
  
print(n)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a==b:
  print(1)
  break
else:
  num=0
  hoge=a
  while b>hoge:
    hoge+=a
    num+=1
    print(num)
Problem p03261 (python)

Fixed submission:
from collections import Counter

n=int(input())
l=[input() for i in range(n)]

if Counter(l).most_common()[0][1] != 1:
  ans="No"
else:
  l_head = [l[i+1][0] for i in range(n-1)]
  l_tail = [l[i][-1] for i in range(n-1)]
  if l_head == l_tail:
    ans="Yes"
  else:
    ans="No"
    
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
l=[input() for i in range(n)]

if l.most_common()[0][1] != 1:
  ans="No"
else:
  l_head = [i[0] for i in l]
  l_tail = [i[-1] for i in l]
  if l_head == l_tail:
    ans="Yes"
  else:
    ans="No"
    
print(ans)
Problem p03273 (python)

Fixed submission:
h,w=map(int,input().split())
lis=[list(input()) for i in range(h)]

fin=[]
num=[0]*w

for l in lis:
  if l.count(".") != w:
    fin.append(l)
  for i in range(w):
    if l[i]==".":
      num[i]+=1

for f in fin:
  ans=[]
  for i in range(len(num)):
    if num[i]!=h:
      ans.append(f[i])
  print(*ans,sep='')

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

fin=[]
ans=[]

for l in lis:
  if l.count(".") != w:
    fin.append(l)
  else:  
    h=h-1

tr = []
for i in range(w):
    tr_row = []
    for vector in fin:
        tr_row.append(vector[i])
    tr.append(tr_row)
    
for t in tr:
  if t.count(".") != h:
    ans.append(t)
  else:  
    w=w-1
    
for i in range(w):
    tr_row = []
    for vector in ans:
        tr_row.append(vector[i])
    print(*tr_row)

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

fin=[]

for l in lis:
  if l.count(".") != w:
    fin.append(l)
  else:  
    h=h-1

num=[]
for i in range(w):
  cnt=0
  for f in fin:
    if f[i] == ".":
      cnt+=1
  if cnt == h:
    num.append(i)
      
for i in num:
  for f in fin:
    f.pop(i)
    
for i in fin:
  print(*i)
Problem p03319 (python)

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

cnt=1
num=k
while num<n:
  num+=(k-1)
  cnt+=1
  
print(cnt)

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

cnt=1
num=k
while num<n:
  num+=(k-1)
  cnt+=1
  
print(cnt)

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

cnt=1
num=3
while num<n:
  num+=2
  cnt+=1
  
print(cnt)
Problem p03419 (python)

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

if n>=3 and m>=3:
  a=n*m
  b=n*2+m*2-4
  ans=a-b
elif n==1 and m==1:
  ans=1
elif n==1 or m==1:
  a=n*m
  b=2
  ans=a-b
elif n==2 or m==2:
  ans=0
  
print(ans)

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

if n>=3 and m>=3:
  a=n*m
  b=n*2+m*2-4
  ans=a-b
elif n==1 and b==1:
  ans=1
elif n==1 or m==1:
  a=n*m
  b=2
  ans=a-b
elif n==2 or m==2:
  ans=0
  
print(ans)

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

if n>=3 and m>=3:
  a=n*m
  b=n*2+m*2-
  ans=a-b
elif n==1 and b==1:
  ans=1
elif n==1 or m==1:
  a=n*m
  b=2
  ans=a-b
elif n==2 or m==2:
  ans=0
  
print(ans)

Buggy submission (verdict: Runtime Error):
n,m=int(input())

if n>=3 and m>=3:
  a=n*m
  b=n*2+m*2-4
elif n==1 or m==1:
  a=n*m
  b=2
elif n==2 or m==2:
  a=0
  b=0
  
print(a-b)
Problem p03435 (python)

Fixed submission:
c=[list(map(int,input().split())) for i in range(3)]
if (c[0][0]+c[1][1]+c[2][2])*2==c[0][1]+c[0][2]+c[1][0]+c[1][2]+c[2][0]+c[2][1]:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
l=[list(map(int,input())) for i in range(3)]

sum_l=0
ans="No"

for i in l:
  sum_l+=sum(i)
  
if sum_l%3==0:
  ans="Yes"

print(ans)
Problem p03448 (python)

Fixed submission:
a=int(input())
b=int(input())
c=int(input())
x=int(input())

ans=0
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      num_500=500*i
      num_100=100*j
      num_50=50*k
      if num_500+num_100+num_50==x:
        ans+=1
        
print(ans)

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

for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      num_500=500*i
      num_100=100*j
      num_50=50*k
      if num_500+num_100+num_50==x:
        ans+=1
        
print(ans)
Problem p03456 (python)

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

n=a+b
 
for i in range(int(n)//2):
  if i**2==int(n):
    ans="Yes"
    break
  else:
    ans="No"
print(ans)

Buggy submission (verdict: Runtime Error):
a=str(input())
b=str(input())

n=a+b
 
for i in range(int(n)//2):
  if i**2==int(n):
    ans="Yes"
    break
  else:
    ans="No"
print(ans)

Buggy submission (verdict: Runtime Error):
a,b=str(input()),str(input())
n=a+b

for i in range(n//2):
  if i**2==n:
    print("Yes")
    break
  else:
    print("No")
Problem p03457 (python)

Fixed submission:
n=int(input())

num,a,b=0,0,0

for i in range(n):
  t,x,y=map(int,input().split())
  num,a,b=abs(t-num),abs(x-a),abs(y-b)
  su=a+b
  if num>=su and num%2 == su%2:
    ans="Yes"
  else:
    ans="No"
    break
      
print(ans)

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

num,a,b=0,0,0

for i in range(n):
  t,x,y=map(int,input().split())
  num,a,b=abs(t-num),abs(x-a),abs(y-b)
  su=a+b
  if num<su:
    ans="No"
    break
  else:
    if num%su==0:
      ans="Yes"
    elif su==0 and num%2==0:
      ans="Yes"
    else:
      ans="No"
      
print(ans)

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

num,a,b=0,0,0

for i in range(n):
  t,x,y=map(int,input().split())
  num,a,b=abs(t-num),abs(x-a),abs(y-b)
  su=a+b
  if num<su:
    ans="No"
    break
  else:
    if num%su==0:
      ans="Yes"
    else:
      ans="No"
      
print(ans)

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

t,x,y=map(int,input().split())
num=x+y

if t%num!=0:
  print("No")
  exit()
if n==1:
  print("Yes")
  exit()

for i in range(n-1):
  t,x,y=map(int,input().split())
  num-=(x+y)
  num=abs(num)
  if t%num!=0:
    print("No")
    exit()
    
print("Yes")

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

num=0

t,x,y=map(int,input().split())
num+=(x+y)
if t%num!=0:
  print("No")
  exit()
if n==1:
  print("Yes")
  
for i in range(n-1):
  t,x,y=map(int,input().split())
  num-=(x+y)
  num=abs(num)
  if t%num!=0:
    print("No")
    exit()
    
print("Yes")

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

num=0

t,x,y=map(int,input().split())
num+=(x+y)
if t%num!=0:
  print("NO")
  exit()
  
for i in range(n-1):
  t,x,y=map(int,input().split())
  num-=(x+y)
  num=abs(num)
  if t%num!=0:
    print("NO")
    exit()
    
print("YES")
Problem p03486 (python)

Fixed submission:
s=str(input())
t=str(input())

l="abcdefghijklmnopqrstuvwxyz"

ss=''.join(sorted(s))
st=''.join(sorted(t))
str=''.join(sorted(t,reverse=True))

if l.index(str[0])>l.index(ss[0]):
  ans="Yes"
elif len(t)>len(s) and ss in st:
  ans="Yes"
else:
  ans="No"
  
print(ans)

Buggy submission (verdict: Runtime Error):
s=str(input())
t=str(input())

l="abcdefghijklmnopqrstuvwxyz"

ss=''.join(sorted(s))
st=''.join(sorted(t))
str=''.join(sorted(t,reverse=True))

if l.index(str[1])>l.index(ss[1]):
  ans="Yes"
elif len(t)>len(s) and ss in st:
  ans="Yes"
else:
  ans="No"
  
print(ans)
Problem p03544 (python)

Fixed submission:
n=int(input())

if n==1:
  print(1)
elif n==2:
  print(3)
else:
  ans=0
  num_1=2
  num_2=1
  for i in range(n-1):
    ans = num_1+num_2
    num_1,num_2 = num_2, ans
  print(ans)

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

if n==1:
  print(2)
elif n==2:
  print(1)
else:
  ans=0
  num_1=2
  num_2=1
  for i in range(n-1):
    ans = num_1+num_2
    num_1,num_2 = num_2, ans

print(ans)
Problem p03574 (python)

Fixed submission:
h,w=map(int,input().split())
l=[list(input()) for i in range(h)]

ans=[[0]*w for i in range(h)]

for i in range(h):
  for j in range(w):
    if l[i][j]=='#':
      ans[i][j]='#'
    else:
      for p in range(-1,2):
        for q in range(-1,2):
          if 0<=i+p<h and 0<=j+q<w and l[i+p][j+q]=='#':
            ans[i][j]+=1
            
for i in range(h):
  print(*ans[i],sep='')

Buggy submission (verdict: Runtime Error):
h,w=map(int,input().split())

l=[list(input()) for i in range(h)]
ans=[[0]*w for i in range(h)]

for i in range(h):
  for j in range(w):
    if l[i][j]=="#":
      ans[i][j]=="#"
    else:
      for a in range(-1,2):
        for b in range(-1,2):
          if i+a<h and j+b<w ansl[i+a][j+b]=="#":
            ans[i][j]+=1
            
for i in range(h):
  print(*ans[i])
Problem p03639 (python)

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

c_4=0
even=0
odd=0

for i in l:
  if i%4==0:
    c_4+=1
  elif i%2==0:
    even+=1
  else:
    odd+=1
  
if even==0 and odd-1 <= c_4:
  ans="Yes"
else:
  ans="No"
  
if even>0 and odd <= c_4:
  ans="Yes"
else:
  "No"

print(ans)

Buggy submission (verdict: Runtime Error):
import math

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

c_4=0
c_2=0

for i in l:
  if i%4==0:
    c_4+=1
  elif i%2==0:
    c_2+=1


if c_2==1:
  num=n
else:
  num=n-c_2  
  
if matj.ceil(num/2) <= c_4:
  ans="Yes"
elif c_2==n:
  ans="Yes"
else:
  ans="No"
  
print(ans)
Problem p03699 (python)

Fixed submission:
n=int(input())
l=[int(input()) for i in range(n)]

lis=[i for i in l if i%10!=0]

sum_l=sum(l)

if sum_l%10!=0:
  print(sum_l)
else:
  if len(lis)==0:
    print(0)
  else:
    print(sum_l-min(lis))

Buggy submission (verdict: Runtime Error):
n=int(input())
l=[int(input()) for i in range(n)]

l_5=[i for i in l if i%5==0 and i%10!=0]
l_10=[i for i in l if i%10==0]

sum_l=sum(l)

if sum_l%10!=0:
  print(sum_l)
else:
  if len(l_10)==n:
    print(0)
  else:
    print(sum_l-min(l_5))
Problem p03730 (python)

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

ans="NO"
for i in range(0,b+1):
  for j in range(0,a+1):
    if a*i == b*j+c:
      ans="YES"
      break
      
print(ans)

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

ans="No"
for i in range(1,b+1):
  for j in range(1,a+1):
    if a*i=b*j+c:
      ans="Yes"
      break
      
print(ans)
Problem p03845 (python)

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

sum_l=sum(l)

for i in range(m):
  p,x=map(int,input().split())
  ans=sum_l-l[p-1]+x
  print(ans)

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

sum_l=sum(l)

for i in range(m):
  p,x=map(int,input().split())
  ams=sum_l-l[p-1]+x
  print(ans)
Problem p02993 (python)

Fixed submission:
S = list(input())
S.append("%")
a=0
for i in range(4):
    if ( S[i] == S[i+1]):
        a =1

if a == 1:
    print("Bad")
else:
    print("Good")

Buggy submission (verdict: Runtime Error):
N,L=map(int, input().split())
 
sum = 0
lower = 100
for i in range(1, N+1):
    sum = sum + L + i -1
for i in range(1, N+1):
    s = abs(L + i -1)
    if s < lower:
        lower = s
        ij = i
 
print(sum - (L + ij -1))
Problem p02994 (python)

Fixed submission:
N,L=map(int, input().split())
 
sum = 0
lower = 100000
for i in range(1, N+1):
    sum = sum + L + i -1
for i in range(1, N+1):
    s = abs(L + i -1)
    if s < lower:
        lower = s
        ij = i
 
print(sum - (L + ij -1))

Buggy submission (verdict: Runtime Error):
N,L=map(int, input().split())
 
sum = 0
lower = 100
for i in range(1, N+1):
    sum = sum + L + i -1
for i in range(1, N+1):
    s = abs(L + i -1)
    if s < lower:
        lower = s
        ij = i
 
print(sum - (L + ij -1))
Problem p02603 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = 1000

for i in range(1, n):
    stock = 0
    if a[i - 1] < a[i]:
        stock = ans // a[i - 1]
    ans += (a[i] - a[i - 1]) * stock

print(ans)

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

sell = []

for i in range(1, n):
    if a[i - 1] < a[i]:
        sell.append(i)

for i in range(len(sell)):
    if i == 0:
        l = 0
    else:
        l = sell[i - 1] + 1
    r = sell[i] - 1
    stock = ans // min(a[l:r + 1])
    ans += (a[sell[i]] - min(a[l:r + 1])) * stock

print(ans)
Problem p02613 (python)

Fixed submission:
n = int(input())
ac = 0
wa = 0
tle = 0
re = 0
for _ in range(n):
    s = input()
    if s == "AC":
        ac += 1
    elif s == "WA":
        wa += 1
    elif s == "TLE":
        tle += 1
    elif s == "RE":
        re += 1

print("AC x", ac)
print("WA x", wa)
print("TLE x", tle)
print("RE x", re)

Buggy submission (verdict: Runtime Error):
n = int(input())
ac = 0
wa = 0
tle = 0
re = 0
for _ in range(n):
    s = input()
    if s == "AC":
        ac += 1
    elif s == "WA":
        wa += 1
    elif s == "TLE":
        tle += 1
    elif sv == "RE":
        re += 1

print("AC x", ac)
print("WA x", wa)
print("TLE x", tle)
print("RE x", re)