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

Fixed submission:
import sys
def sieve(N):
    if N<2:
        prime = [False for i in range(N+1)]
        return prime
 
    prime = [True for i in range(N+1)]
    prime[0] = False
    prime[1] = False
 
    for i in range(2, int(N**0.5)+1):
        if prime[i]:
            for j in range(i*2, N+1, i):
                prime[j] = False
 
    return prime

l=sieve(100057)
x=int(input())
while True:
    if l[x]==True:
        print(x)
        sys.exit()
    x+=1

Buggy submission (verdict: Runtime Error):
def Sieve_of_Eratosthenes(N):
    if N<2:
        prime = [False for i in range(N+1)]
        return prime
 
    prime = [True for i in range(N+1)]
    prime[0] = False
    prime[1] = False
 
    for i in range(2, int(N**0.5)+1):
        if prime[i]:
            for j in range(i*2, N+1, i):
                prime[j] = False
 
    return prime

prime=Sieve_of_Eratosthenes(10**5)
x=int(input())
while prime[x]==False:
    x+=1
print(x)
Problem p02835 (python)

Fixed submission:
a=list(map(int,input().split()))
if sum(a)>=22: print('bust')
else: print('win')

Buggy submission (verdict: Runtime Error):
def main():
    h,w=map(int,input().split())
    L=80*(h+w)+1
    a=[list(map(int,input().split())) for i in range(h)]
    b=[list(map(int,input().split())) for i in range(h)]


    x=[[abs(a[i][j]-b[i][j]) for j in range(w)] for i in range(h)]
    

    L=12800
    
    state=[[0 for j in range(w)] for i in range(h)]
    delta=x[0][0]
    state[0][0]=(2**L>>delta)|(2**L<<delta)

    for j in range(1,w):
        delta=x[0][j-1]
        state[0][j]=(state[0][j-1]>>delta)|(state[0][j-1]<<delta)

    for i in range(1,h):
        delta=x[i-1][0]
        state[i][0]=(state[i-1][0]>>delta)|(state[i-1][0]<<delta)

    for i in range(1,h):
        for j in range(1,w):
            delta=x[i][j]
            state[i][j]=(state[i][j-1]>>delta)|(state[i][j-1]<<delta)
            state[i][j]=(state[i-1][j]>>delta)|(state[i-1][j]<<delta)

    
    ans = 10**9
    for i in range(L*2):
        if state[h-1][w-1] & 1:
            ans = min(ans,abs(i-L))
        state[h-1][w-1]>>=1
    print(ans-1)



if __name__ == '__main__':
    main()
Problem p02897 (python)

Fixed submission:
n=int(input())
print(1-(n//2)/n)

Buggy submission (verdict: Runtime Error):
def main():
    N,M=map(int,input().split())
    L=2**N
    dp=[10**7 for i in range(L)]
    dp[0]=0


    for i in range(M):
        a, _ = map(int, input().split())
        key=sum([2**(int(i)-1) for i in input().split()])
        for j in range(L):
                q=j|key
                dp[q]=min(dp[j]+a,dp[q])


    ans=dp[L-1]
    print(ans if ans<10**7 else -1)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    N,M=map(int,input().split())
    L=2**N
    dp=[10**10 for i in range(L)]
    dp[0]=0


    for i in range(M):
        a, _ = map(int, input().split())
        key=sum([1<<(int(i)-1) for i in input().split()])
        for j in range(L):
                q=j|key
                dp[q]=min(dp[j]+a,dp[q])


    ans=dp[L-1]
    print(ans if ans<10**10 else -1)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
a=[]
for i in range(M):
    tmp=list(map(int,input().split()))
    tmpc=list(map(int,input().split()))
    c=0
    for j in range(len(tmpc)):
        c+=2**(tmpc[j]-1)
    tmp[1]=c
    a+=[tmp]


dp=[[10**10 for j in range(2**N)] for i in range(M)]
dp[0][0]=0
dp[0][a[0][1]]=a[0][0]


for i in range(1,M):
    dp[i]=dp[i-1]
    for j in range(2**N):
        if dp[i-1][j]<10**10:
            q=j|a[i][1]
            dp[i][q]=min(dp[i-1][j]+a[i][0],dp[i][q])

ans=dp[M-1][2**N-1]
print(ans if ans<10**10 else -1)
Problem p02933 (python)

Fixed submission:
a=int(input())
print(input() if a>=3200 else "red")

Buggy submission (verdict: Runtime Error):
n,q=map(int,input().split())
neighbor=[[]  for _ in range(n+1)]
ans=[0]*(n+1)

for _ in range(n-1):
    a,b=map(int,input().split())
    neighbor[a].append(b)
    neighbor[b].append(a)


for _ in range(q):
    p,x=map(int,input().split())
    ans[p]+=x

visit=[True]*(n+1)
tmp=[1]
for x in tmp:
    visit[x]=False
    for y in neighbor[x]:
        if visit[y]:
            tmp.append(y)
            ans[y]+=ans[x]

print(*ans[1:])
Problem p02954 (python)

Fixed submission:
import sys
s=input()
n=len(s)
p=[0 for _ in range(n)]

for i in range(n):
    if s[i]=="L": p[i]=p[i-1]-1 if s[i-1]=="L" else -1
for i in range(n-1,-1,-1):
    if s[i]=="R": p[i]=p[i+1]+1 if s[i+1]=="R" else 1

ans=[0]*n
for i in range(n):
    if p[i]>0:
        ans[i+(p[i]//2)*2]+=1
    else:
        if p[i]%2==0: ans[i+p[i]]+=1
        else: ans[i+p[i]+1]+=1
print(*ans)

Buggy submission (verdict: Runtime Error):
import sys
def cur(i):
    if p[i]!=False: return p[i]
    if s[i]=="R":
        if s[i+1]=="L": p[i]=1
        else: p[i]=cur(i+1)+1
    if s[i]=="L":
        if s[i-1]=="R": p[i]=-1
        else: p[i]=cur(i-1)-1 
    return p[i]

s=input()
n=len(s)
p=[False for _ in range(n)]

for i in range(n):
    cur(i)
sys.exit()
ans=[0]*n
for i in range(n):
    if p[i]>0:
        ans[i+(p[i]//2)*2]+=1
    else: ans[i+p[i]+p[i]%2]+=1
print(*ans)

Buggy submission (verdict: Runtime Error):
def cur(i):
    if p[i]!=False: return p[i]
    if s[i]=="R":
        if s[i+1]=="L": p[i]=1
        else: p[i]=cur(i+1)+1
    if s[i]=="L":
        if s[i-1]=="R": p[i]=-1
        else: p[i]=cur(i-1)-1 
    return p[i]

s=input()
n=len(s)
p=[False for _ in range(n)]

for i in range(n):
    cur(i)

ans=[0]*n
for i in range(n):
    if p[i]>0:
        ans[i+(p[i]//2)*2]+=1
    else: ans[i+p[i]+p[i]%2]+=1
print(*ans)
Problem p03075 (python)

Fixed submission:
import math
import sys

a=[int(input()) for i in range(5)]
k=int(input())

for i in range(5):
        for j in range(5):
                if a[i]-a[j]>k:
                        print(":(")
                        sys.exit()

print("Yay!")

Buggy submission (verdict: Runtime Error):
import math
import sys

X,Y,Z,K=map(int,input().split())

x=sorted(list(map(int,input().split())),reverse=True)
y=sorted(list(map(int,input().split())),reverse=True)
z=sorted(list(map(int,input().split())),reverse=True)



"""
if X*Y*Z<=3000:
    ans=[]
    for i in range(X):
        for j in range(Y):
            for k in range(Z):  ans.append(x[i]+y[j]+z[k])
    ans.sort()
    for i in range(min(3000,X*Y*Z)):
        print(ans[i])
    sys.exit()
"""

yz=[]
for i in range(Y):
    yz=yz+[ y[i]+z[j] for j in range(Z)]

yz.sort(reverse=True)

if len(yz)>K:
    yz=yz[:K]


n=len(yz)
ans=[]

for i in range(X):
    tmp=[yz[j]+x[i] for j in range(len(yz))]
    ans =ans+tmp

ans.sort(reverse=True)


for i in range(K):
    print(ans[i])
Problem p03127 (python)

Fixed submission:
def egcd(a, b):
    (x, lastx) = (0, 1)
    (y, lasty) = (1, 0)
    while b != 0:
        q = a // b
        (a, b) = (b, a % b)
        (x, lastx) = (lastx - q * x, x)
        (y, lasty) = (lasty - q * y, y)
    gcd=a
    return gcd

    
N=int(input())
HP=list(map(int,input().split()))

tmp=egcd(HP[0],HP[1])

for i in range(1,N-1):
    tmp=egcd(tmp,HP[i+1])
    
print(tmp)

Buggy submission (verdict: Runtime Error):
import math

N=int(input())
HP=list(map(int,input().split()))
 
tmp=HP[0]
 
for i in range(0,N):
    tmp=math.gcd(tmp,HP[i])
    
print(tmp)

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

tmp=egcd(HP[0],HP[1])

for i in range(1,N-1):
    a=tmp
    b=HP[i+1]
    
    (x, lastx) = (0, 1)
    (y, lasty) = (1, 0)
    while b != 0:
        q = a // b
        (a, b) = (b, a % b)
        (x, lastx) = (lastx - q * x, x)
        (y, lasty) = (lasty - q * y, y)
        
    tmp=a
    
print(tmp)
Problem p03221 (python)

Fixed submission:
N,M=map(int,input().split())
a=[[i]+list(map(int,input().split())) for i in range(M)]
a.sort(key=lambda x:(x[1],x[2]))

j=0
for i in range(M):
    if j!=a[i][1]:
        j=a[i][1]
        k=1
    s=format(a[i][1],'0>6') + format(k,'0>6')
    a[i].append(s)
    k+=1

a.sort()
for i in range(M):
    print(a[i][3])

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
x=[[] for _ in range(n+1)]
ans=[False]*(n+1)
for i in range(m):
    p,y=map(int,input().split())
    x[p].append([y,i])

for p in range(1,n+1):
    x[p].sort()
    for j in range(len(x[p])):
        ans[x[p][j][1]]=str(p).zfill(6)+str(j+1).zfill(6)

for i in range(n+1):
    print(ans[i])

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
x=[[] for _ in range(n+1)]
ans=[False]*(n+1)
for i in range(m):
    p,y=map(int,input().split())
    x[p].append([y,i])

for p in range(1,n+1):
    x[p].sort()
    for j in range(len(x[p])):
        ans[x[p][j][1]]=str(p).zfill(6)+str(j+1).zfill(6)

for i in range(n+1):
    print(ans[i])
Problem p03315 (python)

Fixed submission:
s=input()
ans=0
for i in range(4):
    if s[i]=="+": ans+=1
    else: ans-=1

print(ans)

Buggy submission (verdict: Runtime Error):
def f(n):
    s=str(n)
    return sum([int(s[i]) for i in range(len(s))])

sunuke=[]
for i in range(100):
    for j in range(2,11):
        sunuke.append(j*(10**i)-1)
L=len(sunuke)
tmp1,tmp2=sunuke[L-1],f(sunuke[L-1])
ans=[sunuke[L-1]]
for i in range(len(sunuke)-2,-1,-1):
    x=sunuke[i]
    if x*tmp2<=tmp1*f(x):
        ans.append(x)
        tmp1,tmp2=x,f(x)

ans.sort()

    

for i in range(int(input())):
    print(ans[i])
Problem p03327 (python)

Fixed submission:
n=int(input())
print("ABC" if n<1000 else "ABD")

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

D=[list(map(int,input().split())) for i in range(C)]
grid=[list(map(int,input().split())) for i in range(N)]

a=[[0]*C for i in range(3)]


for i in range(N):
    tmp=i%3
    for j in range(N):
        a[tmp][grid[i][j]-1]+=1
        tmp=(tmp+1)%3

b=[[0]*C for i in range(3)]
for i in range(3):
    for j in range(C):
        b[i][j]=sum([ D[k][j] * a[i][k] for k in range(C)])

b=[ sorted([ [b[i][j],j] for j in range(C)]) for i in range(3)]

ans=1000000000
for i in range(3):
    for j in range(3):
        for k in range(3):
            if b[0][i][1]!=b[1][j][1] and b[1][j][1]!=b[2][k][1] and b[2][k][1]!=b[0][i][1]:
                ans=min(ans,b[0][i][0]+b[1][j][0]+b[2][k][0])

print(ans)
Problem p02707 (python)

Fixed submission:
n = int(input())
aList = list(map(int, input().split()))
t = [0 for i in range(200001)]
for a in aList:
    t[a] += 1
for i in range(1, n+1):
    print(t[i])

Buggy submission (verdict: Runtime Error):
n = int(input())
aList = list(map(int, input().split()))
t = [0 for i in range(20001)]
for a in aList:
    t[a] += 1
for i in range(1, n+1):
    print(t[i])
Problem p02990 (python)

Fixed submission:
import math
n, k = map(int, input().split())
 
def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
 
for i in range(1, k+1):
    if i <= n - k + 1:
        c = 1
        c *= comb(n-k+1, i)
        c *= comb(k-1, i-1)
        print(c%(10**9+7))
    else:
        print(0)

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

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

for i in range(1, k+1):
    c = 1
    c *= comb(n-k+1, i)
    c *= comb(k-1, i-1)
    print(c%(10**9+7))

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

for i in range(1, k+1):
    c = 1
    for j in range(i):
        c *= n - k + 1 - j
    for l in range(i-1):
        c *= k - 1 - l
    c /= math.factorial(i)
    c /= math.factorial(i - 1)
    print(int(c)%(10**9+7))
Problem p03107 (python)

Fixed submission:
#ABC120C-Unification.py

from sys import stdin

input = stdin.readline

S = input().rstrip()

Nblock = min(S.count('1'), S.count('0'))

print(Nblock*2)

Buggy submission (verdict: Runtime Error):
#ABC120C-Unification.py

from sys import stdin

input = stdin.readline

S = input()

Nblock = 0

while '0' in S and '1' in S:
    for i in range(len(S)-1):
        if S[i:i+1] != S[i+1:i+2]:
            Nblock += 2
            S = S[:i] + S[i+2:]
            print(S)
            break

print(Nblock)
Problem p03127 (python)

Fixed submission:
#ABC118C-MonstersBattleRoyale.py

from sys import stdin
from functools import reduce
import fractions

input = stdin.readline

N = int(input())

A = list(set(map(int,input().split())))

answer = reduce(fractions.gcd, A)
print(answer)

Buggy submission (verdict: Runtime Error):
#ABC118C-MonstersBattleRoyale.py

from sys import stdin
from functools import reduce
import math

input = stdin.readline

N = int(input())

A = list(set(map(int,input().split())))

answer = reduce(math.gcd, A)
print(answer)

Buggy submission (verdict: Runtime Error):
#ABC118C-MonstersBattleRoyale.py

from sys import stdin
from functools import reduce
import math

input = stdin.readline

N = int(input())

A = list(set(map(int,input().split())))

print(reduce(math.gcd, A))
Problem p02659 (python)

Fixed submission:
a, b = input().split()
a = int(a)
b = int(b.replace('.', ''))
print(a*b//100)

Buggy submission (verdict: Runtime Error):
import math
a, b = map(float, input().split()
print(math.floor(a*(b*100)/100))

Buggy submission (verdict: Runtime Error):
import math
a, b = map(float, input().split()
print(math.floor(a*(b*100)/100)
Problem p02707 (python)

Fixed submission:
import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int, input().split()))
ans = [0] * n
for i in a:
    ans[i-1] += 1
for j in ans:
    print(j)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int, input().split())
for i in a:
    print(a.count(str(i+1)))

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
n = int(input())
a = list(input())
for i in a:
    print(a.count(str(i+1)))
Problem p02771 (python)

Fixed submission:
x = list(map(int, input().split()))
x = sorted(x)
if x.count(x[1]) == 2:
     print("Yes")
else:
     print("No")

Buggy submission (verdict: Runtime Error):
x = list(map(int, input().split()))
print(x)
x = sorted(x)
print(x)
if count(x[1]) == 2:
     print("Yes")
else:
     print("No")
Problem p02831 (python)

Fixed submission:
import fractions
a, b = map(int, input().split())
a = a // fractions.gcd(a, b)
print(a * b)

Buggy submission (verdict: Runtime Error):
import math
a, b = map(int, input().split())
a = a // math.gcd(a, b)
print(a * b)
Problem p02847 (python)

Fixed submission:
s = input()
x = [ '0', 'SAT', 'FRI', 'THU', 'WED', 'TUE', 'MON', 'SUN']
for i in range(len(x)):
     if s == x[i]:
          print(i)

Buggy submission (verdict: Runtime Error):
s = input()
x = [ '0', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT', 'SUN' ]
for i in range x:
     if s == x[i]:
          print(i)
Problem p02948 (python)

Fixed submission:
import heapq
N,M=map(int,input().split())
l=[[] for i in range(M+1)]
#print(l)
for i in range(N):
  a,b=map(int,input().split())
  if a<=M:
  #print(a,b)
  #print(l[a])
    l[a].append(b)
#print(l)
ans=0
que=[]
for i in range(1,M+1):
  for j in l[i]:
    heapq.heappush(que,-j)
  if len(que)>0:
    #print(i,que)
    ans-=heapq.heappop(que)
    
    
print(ans)

Buggy submission (verdict: Runtime Error):
import heapq
N,M=map(int,input().split())
l=[[] for i in range(M+1)]
#print(l)
for i in range(N):
  a,b=map(int,input().split())
  #print(a,b)
  #print(l[a])
  l[a].append(b)
#print(l)
ans=0
que=[]
for i in range(1,M+1):
  for j in l[i]:
    heapq.heappush(que,-j)
  if len(que)>0:
    #print(i,que)
    ans-=heapq.heappop(que)
    
    
print(ans)
Problem p02990 (python)

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

#kaijou
kk=[1]
a=1
for i in range(0,N):
  a=a*(i+1)
  kk.append(a)
#print(kk)
  
for i in range(0,K):
  j=i+1
  if N-K-j+1<0:
    print("0")
  else:
    aaa=(kk[N-K+1]//(kk[N-K-j+1]*kk[j]))%(10**9+7)
    bbb=(kk[K-1]//(kk[K-j]*kk[j-1]))%(10**9+7)
    #print(j,aaa,"aaa",bbb,"bbb")
    ccc=aaa*bbb
    print(int(ccc%(10**9+7)))

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

#kaijou
kk=[1]
a=1
for i in range(0,N):
  a=a*(i+1)
  kk.append(a)
#print(kk)
  
for i in range(0,K):
  j=i+1
  if N-K-j+1<0:
    print("0")
  else:
    aaa=int(kk[N-K+1]/(kk[N-K-j+1]*kk[j]))
    bbb=int(kk[K-1]/(kk[K-j]*kk[j-1]))
    #print(aaa,"aaa",bbb,"bbb")
    ccc=aaa*bbb
    print(ccc%(10**9+7))

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

#kaijou
kk=[1]
a=1
for i in range(0,N-K+5):
  a=a*(i+1)
  kk.append(a)
#print(kk)
  
for i in range(0,K):
  j=i+1
  if N-K-j+1<0:
    print("0")
  else:
    aaa=int(kk[N-K+1]/(kk[N-K-j+1]*kk[j]))
    bbb=int(kk[K-1]/(kk[K-j]*kk[j-1]))
    #print(aaa,"aaa",bbb,"bbb")
    ccc=aaa*bbb
    print(ccc%(10**9+7))
Problem p03013 (python)

Fixed submission:
N,M=map(int,input().split())
mod=10**9+7
dp=[0]*(N+1)
dp[0]=1
dp[-1]=0
A=[]
for i in range(M):
  A.append(int(input()))
A=set(A)
#print(A)
for i in range(1,N+1):
  if dp[i-1]==0 and dp[i-2]==0:
    break
  elif i in A:
    continue
  else:
    dp[i]=(dp[i-1]+dp[i-2])%mod
print(dp[N]%mod)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
mod=10**9+7
n1=0
n2=0
A=[]
for i in range(M):
  n1=n2
  n2=int(input())
  #print(n2-n1+1)
  A.append(n2-n1-2)
A.append(N-n2-1)
if A[0]==-1:
  A.pop(0)
else:
  A[0]=A[0]+1
#print(A)
mx=max(A)
dp=[0 for i in range(mx+1)]
dp[0]=1
dp[1]=1
for i in range(mx-1):
  dp[i+2]=(dp[i]+dp[i+1])%mod
dp[0]=0
dp.append(0)
#print(dp)
ans=1
for i in range(len(A)):
  ans=(ans*dp[A[i]])%mod
print(ans)

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

a1=int(input())
a2=a1
data=[a1]
ans_data=[]
for i in range(M-1):
  a1=a2
  a2=int(input())
  #print("a",a2-a1-1)
  data.append(a2-a1-1)
  
data.append(N-a2-1)
  
data=sorted(data)
#print(data)
if  data[0]==0:
  print(0)
  
elif data[M]==1:
  print(1)
else:
  mm=data.count(1)
  ma=2
  #print("mm=",mm)
  f1=1
  f2=2
  for i in range(0,data[M]+len(data)-2-mm):  
      
    if ma==data[mm]:
      ans_data.append(f2)
      #print("data[mm]",data[mm],"f2",f2,"i",i)
      mm=mm+1
     
    else:
      ma=ma+1
      f11=f1
      f1=f2
      f2=f1+f11
      #print("data[mm]",data[mm],"f2",f2,"ma",ma)
        
        
  ans=1
  #print("ans_data",ans_data)
  for i in range(0,len(ans_data)):
    ans=ans*ans_data[i]
    
  mod=10**9+7
  print(ans%mod)
Problem p03075 (python)

Fixed submission:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
f=[a,b,c,d,e]
ma=max(f)
mi=min(f)
if ma-mi>k:
  print(":(")
else:
  print("Yay!")

Buggy submission (verdict: Runtime Error):
data=[]
N=0

for i in range(0,X):
  while N<K:
    for j in range(0,Y):
      while N<K:
        for k in range(0,Z):
          while N<K:
            data.append(int(A[i]+B[j]+C[k]))
            N=N+1
    
data.sort()
data.reverse()

for l in range(K):
  print(data[l])
Problem p02659 (python)

Fixed submission:
def main():
    A, B = input().split()
    A = int(A)
    B_big, B_small = B.split(".")
    B_big = int(B_big)
    B_small = int(B_small)
    print(A*B_big + A*B_small//100)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    A, B = input().split()
    A = int(A)
    B_big, B_small = B.split(".")
    B_big = int(B_big)
    B_small = int(B_small)
    print(A*B + int(A*B_small/100))


if __name__ == "__main__":
    main()
Problem p02659 (python)

Fixed submission:
from decimal import Decimal
import math


a, b = input().split()

ax = Decimal(a)
bx = Decimal(b)

ans = ax*bx

print(math.floor(ans))

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

bx = b.replace(".", "")

ans = 0
ans += int(a) * int(bx[0])
ans += int(a[:-1]) * int(bx[1])
ans += int(a[:-2]) * int(bx[2])


print(ans)
Problem p02689 (python)

Fixed submission:
n, m = map(int, input().split())
h = list(map(int, input().split()))
nets = [0]*n

for _ in range(m):
    a,b = map(int, input().split())
    nets[a - 1] = max(nets[a-1], h[b-1])
    nets[b - 1] = max(nets[b-1], h[a-1])

ans = 0

#print(nets)

for i in range(n):
    if (h[i] >nets[i]):
        ans += 1

print(ans)

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

n, m = map(int, input().split())
h = np.array(list(map(int, input().split())))
nets = np.zeros((n,n))

for i in range(m):
    a,b = map(int, input().split())
    nets[a - 1][b - 1] = h[b-1]
    nets[b - 1][a - 1] = h[a-1]

ans = 0

#print(nets)

for i in range(n):
    if (h[i] >max(nets[i])):
        ans += 1

print(ans)

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

n, m = map(int, input().split())
h = np.array(list(map(int, input().split())))
nets = np.zeros((n,n))

for i in range(m):
    a,b = map(int, input().split())
    nets[a - 1][b - 1] = 1
    nets[b - 1][a - 1] = 1

ans = 0

for i in range(n):
    if (h[i] >max(h * nets[i])):
        ans += 1

print(ans)
Problem p02773 (python)

Fixed submission:
import collections

n = int(input())

l = []

for i in range(n):
    l.append(input())
c = collections.Counter(l)
cx = c.most_common()
nm = cx[0][1]
ans = []
ans.append(cx[0][0])
for i in range(1, len(cx)):
    if (nm == cx[i][1]):
        ans.append(cx[i][0])
    else:
        break

ansx = sorted(ans)
for i in range(len(ans)):
    print(ansx[i])

Buggy submission (verdict: Runtime Error):
import collections

n = int(input())

l = []

for i in range(n):
    l.append(input())
c = collections.Counter(l)
cx = c.most_common()
nm = cx[0][1]
for i in range(n):
    if (nm == cx[i][1]):
        print(cx[i][0])
    else:
        break
Problem p02777 (python)

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

ans = a-(s == u)

print("{} {}\n".format(a-(s == u), b-(t == u)))

Buggy submission (verdict: Runtime Error):
red blue
3 4
red
Problem p02879 (python)

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

if(a<10 and b<10):
    print(a*b)
else:
    print(-1)

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

n = int(input())
x = []
for i in range(1,math.floor(math.sqrt(n))+1):
    if(n%i == 0):
        x.append(i+n/i-2-0)
print(round(min(x)))
Problem p02970 (python)

Fixed submission:
n,b = map(int,input().split())
 
print(-(-n//(b*2 +1)))

Buggy submission (verdict: Runtime Error):
 n,b = map(int,input().split())
 
 print(n //(b*2))
Problem p03072 (python)

Fixed submission:
n = int(input())
h = list(map(int,input().split()))
ans=1
tp=h[0]
for j in range(1,n):
    if(h[j]>=tp):
        tp=h[j]
        ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int,input().split()))
ans=1
for j in range(1,n):
    if(h[j]>=h[0]:
       ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
h = [int(input()) for i in range(n)]
ans=1
for j in range(1,n):
    if(h[j]>=h[0]:
       ans+=1
print(ans)
Problem p03075 (python)

Fixed submission:
an = []
for i in range(5):
    an.append(int(input()))
k=int(input())+1
if(an[4]-an[0]<k):
    print("Yay!")
else:
    print(":(")

Buggy submission (verdict: Runtime Error):
an = []
for i in range(5):
    an.append(int(input()))
k=int(input())+1
if(an[]-an[]<k and an[]-an[]<k and an[]-an[]<k and an[]-an[]<k):
    print("Yay!")
else:
    print(":(")
Problem p03242 (python)

Fixed submission:
X = input()
Xn = X.replace("1","N")
Xo = Xn.replace("9","1")
print(Xo.replace("N","9"))

Buggy submission (verdict: Runtime Error):
N = int(input())
NA = int(input())
NX = NA.split(" ")
NW = []
for i in range (1,N+1):
    Ni = int(NX.count(i))
    NW.append(Ni)
NN = NW.sort()
print(NW)
S = 0
for x in range (0,N-2):
    S = S + NW[x]
print(S)
Problem p03250 (python)

Fixed submission:
LX = list(input().split(" "))
LX.sort(reverse=True)
print(int(LX[0]+LX[1])+int(LX[2]))

Buggy submission (verdict: Runtime Error):
LX = list(input().split(" "))sort(reverse=True)
print(int(LX[0]+LX[1])+int(LX[2]))
Problem p03327 (python)

Fixed submission:
N = int(input())
if N <=999:
    print("ABC")
else:
    print("ABD")

Buggy submission (verdict: Runtime Error):
if N <=999:
    print("ABC")
else:
    print("ABD")