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

Fixed submission:
N,K,S=map(int,input().split())
a=(S+1)%pow(10,9)

answer=[S]*K+[a]*(N-K)

print(" ".join(map(str,answer)))

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


base=[]

for i in range(N-K):
    base.append(S//(N-K+1))
base.append(S-(N-K)*S//(N-K+1))

for j in range(K-1):
    base.append(base[i%(N-K+1)-1])



print(" ".join(map(str,base)))
Problem p02817 (python)

Fixed submission:
S,T=map(str,input().split())


print(T+S)

Buggy submission (verdict: Runtime Error):
S=input()
T=input()

print(T+S)
Problem p02841 (python)

Fixed submission:
M1,D1=map(int,input().split())
M2,D2=map(int,input().split())

if D2==1:
    print(1)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
M1,D1=map(int,input().split())
M2,D2=map(int,input().split())

if D2=1:
    print(1)
else:
    print(0)
Problem p02853 (python)

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

prize=0

if X==1:
    prize+=300000
    if Y==1:
        prize+=700000
    elif Y==2:
        prize+=200000
    elif Y==3:
        prize+=100000
    else:
        pass
elif X==2:
    prize+=200000
    if Y==1:
        prize+=300000
    elif Y==2:
        prize+=200000
    elif Y==3:
        prize+=100000
    else:
        pass
elif X==3:
    prize+=100000
    if Y==1:
        prize+=300000
    elif Y==2:
        prize+=200000
    elif Y==3:
        prize+=100000
    else:
        pass
else:
    if Y==1:
        prize+=300000
    elif Y==2:
        prize+=200000
    elif Y==3:
        prize+=100000
    else:
        pass

print(prize)

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

prize=0

if X==1:
    prize+=300000
    if Y==1:
        pprize+=700000
    elif Y==2:
        prize+=200000
    elif Y==3:
        prize+=100000
    else:
        pass
elif X==2:
    prize+=200000
    if Y==1:
        prize+=300000
    elif Y==2:
        prize+=200000
    elif Y==3:
        prize+=100000
    else:
        pass
elif X==3:
    prize+=100000
    if Y==1:
        prize+=300000
    elif Y==2:
        prize+=200000
    elif Y==3:
        prize+=100000
    else:
        pass
else:
    prize+=100000
    if Y==1:
        prize+=300000
    elif Y==2:
        prize+=200000
    elif Y==3:
        prize+=100000
    else:
        pass

print(prize)

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

prize=0

if X==1:
    prize+=300000
    if Y==1:
        pprize+=700000
    elif Y==2:
        prize+=200000
    elif Y==3:
        prize+=100000
    else:
        pass
elif X==2:
    prize+=200000
    if Y==1:
        prize+=300000
    elif Y==2:
        prize+=200000
    elif Y==3:
        prize+=100000
    else:
        pass
elif X==3:
    prize+=100000
    if Y==1:
        prize+=300000
    elif Y==2:
        prize+=200000
    elif Y==3:
        prize+=100000
    else:
        pass

print(prize)
Problem p02861 (python)

Fixed submission:
import math
import itertools

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

li=list(range(N))
co=[]
sum=0

for i in itertools.permutations(li,N):
    co.append(list(i))

for i in range(len(co)):
    for j in range(N-1):
        sum+=((xy[co[i][j]][0]-xy[co[i][j+1]][0])**2+(xy[co[i][j]][1]-xy[co[i][j+1]][1])**2)**(1/2)
print(sum/len(co))

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

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

li=list(range(N))
co=[]
sum=0

for i in itertools.permutations(li,N):
    co.append(list(i))

for i in range(len(co)):
    for j in range(N-1):
        sum+=((xy[co[i][j]][0]-xy[co[i][j+1]][0])**2+(xy[co[i][j]][1]-xy[co[i][j+1]][1])**2)**(1/2)
print({sum/len(co))
Problem p02882 (python)

Fixed submission:
import math

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

if x<=(a**2)*b/2:
  y=x/a*2/b
  print(' {:.10f}'.format(math.atan(b/y)/math.pi*180))
else:
  z=b*2-2*x/(a**2)
  print(' {:.10f}'.format(math.atan(z/a)/math.pi*180))

Buggy submission (verdict: Runtime Error):
import math

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

if x<=a^2*b/2:
  y=x/a*2/b
  print(math.atan(b/y))
else:
  z=b*2-2*x/(a^2)
  print(math.atan(z/a))

Buggy submission (verdict: Runtime Error):
import math

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

if x<=a^2*b/2
  y=x/a*2/b
  print(math.atan(b/y))
else:
  z=b*2-2x/a^2
  print(math.atan(z/a))
Problem p02887 (python)

Fixed submission:
N=int(input())
S=input()

for i in range(N-1):
  if S[i]==S[i+1]:
    N-=1

print(N)

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

for i in range(len(S)-2):
  while S[i]==S[i+1]:
    if S[i]==S[i+1]:
      S.remove(S[i])

print(len(S))
Problem p02898 (python)

Fixed submission:
N,K = map(int,input().split())
h= list(map(int,input().split()))
count=0

for i in range(N):
    if h[i]>=K:
        count+=1
print(count)

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

for i in range(N)
    if h[i]>=K
        count+=1
print(count)
Problem p02899 (python)

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

a=[0]*N

for i in range(N):
    a[A[i]-1]=i+1

print(" ".join(map(str,a)))

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

a=[0]*N

for i in range(N):
    a[A[i]]=i+1

print(" ".join(map(str,a)))

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
box=[]

for i in range(N):
  box.insert(i,A.index(i+1)+1)
print(' '.join(box))

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
box=[]

for i in range(N):
  box.insert(i,A.index(i+1)+1)
print(join(box))

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
box=[]

for i in range(N):
    box.insert(A[i],i)
    print(box)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
box=[]

for i in range(N)
    box.insert(A[i],i)
    print(box)
Problem p02900 (python)

Fixed submission:
import fractions
A,B=map(int,input().split())

base=fractions.gcd(A,B)
count=1


for i in range(2,int(pow(base,1/2)+1)):
    if base==1:
        break
    else:
        if base%i==0:
            count+=1
            while base%i==0:
                base//=i
if base!=1:
    count+=1
print(count)

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

li=[]
base=[]
count=1

for i in range(2,math.gcd(A,B)+1):
    if min(A,B)%i==0 and max(A,B)%i==0:
        li.append(i)
        if max(A,B)%(min(A,B)//i)==0:
            li.append(min(A,B)//i)

for l in li:
    judge=True
    for k in base:
        if l%k==0:
            judge=False
            break
    if judge==True:
        count+=1
        base.append(l)
print(count)
Problem p02909 (python)

Fixed submission:
S=input()

if  S == 'Sunny':
    print('Cloudy')
elif  S == 'Cloudy':
    print('Rainy')
elif  S == 'Rainy':
    print('Sunny')

Buggy submission (verdict: Runtime Error):
S=input()

if  S='Sunny':
  print('Cloudy')
elif  S='Cloudy':
  print('Rainy')
elif  S='Rainy'
  print('Sunny')
Problem p02917 (python)

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

A = 0

for i in range(N-2):
    if i >= 0:
        if B[i] <= B[i+1]:
            A += B[i]
        else:
            A += B[i+1]
print(A+B[0]+B[N-2])

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

A = 0

for i in range(N-2):
    if i >= 0:
        if B[i] <= B[i+1]:
            A += B[i]
        else:
            A += B[i+1]
print(A+B[0]+B[N-1])

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

A = B[1]

for i in range(N):
    if i >= 1:
        if B[i-1] >= B[i]:
          A += B[i-1]
        else:
          A += B[i]
print(A)

Buggy submission (verdict: Runtime Error):
N = int(input())
B = list(map(int,input().split()))
A = B[1]

for i in range(N-1):
    if i >= 1:
       if B[i-1] >= B[i]:
         A += B[i-1]
       else:
         A += B[i]
print(A)

Buggy submission (verdict: Runtime Error):
N = int(input())
B = list(map(int,input().split()))
A = B[i]

for i in range(N-1):
    if i >= 1:
       if B[i-1] >= B[i]:
         A += B[i-1]
       else:
         A += B[i]
print(A)
Problem p02923 (python)

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

count_list = []
count = 0

for i in range(N-1):
  if H[i] >= H[i+1]:
    count += 1
  else:
    count_list.append(count)
    count = 0
else:
  count_list.append(count)
    
print(max(count_list))

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

count_list = []
count = 0

for i in range(N-1):
  if  H[i] >= H[i+1]:
    count += 1
  else:
    count_list.append(count)
    count = 0
else:
  count_list.apend(count)

print(max(count_list))

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

count_list = []
count = 0

for i in range(N-1):
  if  H[i] >= H[i+1]:
    count += 1
  else:
    count_list.append(count)
    count = 0
else:
  countlist.apend(count)

print(max(count_list))

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

count_list=[]
count=0

for i in range(N-1):
  if  H[i]>=H[i+1]:
    count+=1
  else:
    count_list.append(count)
    count=0
else:
  countlist.apend(count)

print(max(count_list))

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

countlist=[]
count=0

for i in range(N-1):
  if  H[i]>=H[i+1]:
    count+=1
  else:
    countlist.append(count)
    count=0
else:
  countlist.apend(count)

print(max(countlist))

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

countlist=[]
count=0

for i in range(N-1):
  if  H[i]>=H[i+1]:
    count+=1
  else:
    countlist.append(count)
    count=0
else:
  countlist.apend(count)
print(max(countlist))

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

countlist=[]
count=0

for i in range(N-1):
    if  H[i]>=H[i+1]:
      count+=1
    else:
      countlist.append(count)
      count=0
else:
  countlist.apend(count)
print(max(countlist))

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

countlist=[]
count=0

for i in range(N-1):
    if  H[i]>=H[i+1]:
      count+=1
    else:
      countlist.append(count)
      count=0
print(max(countlist))

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

list=[]
count=0

for i in range(N-1):
    if  H[i]>=H[i+1]:
      count+=1
    else:
      list.append(count)
      count=0
print(max(list))
Problem p02969 (python)

Fixed submission:
r=int(input())
answer=3*r**2
print(answer)

Buggy submission (verdict: Runtime Error):
r=input()

print(3*r^2)
Problem p02988 (python)

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

count=0

for i in range(n-2):
    q=sorted(p[i:i+3])
    if q[1]==p[i+1]:
        count+=1

print(count)

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

count=0

for i in range(n-2):
    print(q)
    if q[1]==p[i+1]:
        count+=1

print(count)
Problem p02993 (python)

Fixed submission:
S=input()

if S[0] == S[1] or S[1] == S[2] or S[2] == S[3]:
  print ('Bad')

else:
  print ('Good')

Buggy submission (verdict: Runtime Error):
S=input()

for i in range(3):
    if S[i]=S[i+1]:
print('Bad')

    else:
print('Good')
Problem p03000 (python)

Fixed submission:
N,X=map(int,input().split())
L=list(map(int,input().split()))


if L[0]>X:
    print(1)
else:
    D=0
    i=0
    count=1
    while D<=X and i<=N-1:
        if D+L[i]<=X:
            D+=L[i]
            i+=1
            count+=1
        else:
            break
    print(count)

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

count=0
dist=0

i=0
while dist<=X and count<=N:
    dist+=L[count]
    count+=1
    #print(dist)

print(count)

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

count=0
dist=0

i=0
while dist<=X or i<N-1:
    count+=1
    dist+=L[i]
    i+=1
    #print(dist)

print(count)

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

count=0
dist=0

i=0
while dist<=X or i<N:
    count+=1
    dist+=L[i]
    i+=1
    #print(dist)

print(count)

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

count=0
dist=0

i=0
while dist<=X:
    count+=1
    dist+=L[i]
    i+=1
    #print(dist)

print(count)

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

D=L[0]
i=1
count=1

if D>X:
    print(0)
else:
    while D<=X and i<=N:
        D+=L[i]
        i+=1
        count+=1
    print(count)

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

D=0
i=0
count=0

while D<=X and i<=N:
    D+=L[i]
    i+=1
    count+=1
print(count)
Problem p03086 (python)

Fixed submission:
S=input()

ans=[]
count=0

for i in range(len(S)):
    if S[i]=="A" or S[i]=="C" or S[i]=="G" or S[i]=="T":
        count+=1
    else:
        ans.append(count)
        count=0

ans.append(count)

print(max(ans))

Buggy submission (verdict: Runtime Error):
S=input()

ans=[]
count=0

for i in range(len(S)):
    if S[i]=="A" or S[i]=="C" or S[i]=="G" or S[i]=="T":
        count+=1
    else:
        ans.append(count)
        count=0

print(max(ans))
Problem p03231 (python)

Fixed submission:
import fractions
N,M=map(int,input().split())
S=input()
T=input()

n=N//fractions.gcd(N,M)
m=M//fractions.gcd(N,M)
g=fractions.gcd(N,M)
judge=True

for i in range(g):
    if S[i*n]!=T[i*m]:
        judge=False

if judge==True:
    print(N*M//g)
else:
    print(-1)

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

n=N//math.gcd(N,M)
m=M//math.gcd(N,M)
g=math.gcd(N,M)
judge=True

for i in range(g):
    if S[i*n]!=T[i*m]:
        judge=False

if judge==True:
    print(N*M//g)
else:
    print(-1)
Problem p03241 (python)

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

base=M//N
li=[]


for i in range(1,int(pow(M,1/2))+1):
    if i<=base and M%i==0:
        li.append(i)
    if M%i==0 and M//i<=base:
        li.append(M//i)

print(max(li))

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

base=M//N
answer=[0]*N
j=0

for i in range(base,base//2+1,-1):
    if M%i==0:
        answer[j]=i
        break
    elif M%(base-i+1)==0:
        answer[j]=base-i+1
        j+=1
print(max(answer))
Problem p03569 (python)

Fixed submission:
s=input()
li=list(s)

i=0
j=len(s)-1
answer=0

while i<j:
    if li[i]==li[j]:
        i+=1
        j-=1
    else:
        if li[i]!="x" and li[j]!="x":
            answer=-1
            break
        elif li[i]=="x" and li[j]!="x":
            answer+=1
            i+=1
        elif li[i]!="x" and li[j]=="x":
            answer+=1
            j-=1

print(answer)

Buggy submission (verdict: Runtime Error):
s=input()
li=list(s)

i=0
j=len(s)-1
answer=0

while i!=j:
    if li[i]==li[j]:
        i+=1
        j-=1
    else:
        if li[i]!="x" and li[j]!="x":
            answer=-1
            break
        elif li[i]=="x" and li[j]!="x":
            answer+=1
            i+=1
        elif li[i]!="x" and li[j]=="x":
            answer+=1
            j-=1

print(answer)
Problem p03838 (python)

Fixed submission:
x,y=map(int,input().split())

X=abs(x)
Y=abs(y)

if x<y:
    if x*y>0:
        print(abs(X-Y))
    elif x*y==0:
        print(abs(X-Y))
    else:
        print(abs(X-Y)+1)
else:
    if x*y>0:
        print(abs(X-Y)+2)
    elif x*y==0:
        print(abs(X-Y)+1)
    else:
        print(abs(X-Y)+1)

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

X=abs(x)
Y=abs(y)

if x<y:
    if x*y>0:
        print(y-x)
    elif x*y==0:
        print(abs(X-Y))
    else:
        print(abs(X-Y)+1)
else:
    if x*y>=0:
        print(abs(X-Y)+2)
    elif x*y=0:
        print(abs(X-Y)+1)
    else:
        print(abs(X-Y)+1)
Problem p03999 (python)

Fixed submission:
S=input()
s=list(S)

ans=0

if len(S)!=1:
    for i in range(2**(len(s)-1)):
        judge=str(bin(i))[2:].rjust(len(s)-1,"0")
        sum=0
        plus=s[0]
        #print(judge)
        for j,jud in enumerate(judge):
            if jud=="0":
                plus+=s[j+1]
                #print(plus)
            else:
                sum+=int(plus)
                plus=""
                plus+=s[j+1]
        if len(plus)!=0:
            sum+=int(plus)
            #print(plus)
        #print(sum)
        ans+=sum
else:
    ans=int(S)
print(ans)

Buggy submission (verdict: Runtime Error):
S=input()
s=list(S)

ans=0

for i in range(2**(len(s)-1)):
    judge=str(bin(i))[2:].rjust(len(s)-1,"0")
    sum=0
    plus=s[0]
    #print(judge)
    for j,jud in enumerate(judge):
        if jud=="0":
            plus+=s[j+1]
            #print(plus)
        else:
            sum+=int(plus)
            plus=""
            plus+=s[j+1]
    if len(plus)!=0:
        sum+=int(plus)
        #print(plus)
    #print(sum)
    ans+=sum
print(ans)
Problem p02639 (python)

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

Buggy submission (verdict: Runtime Error):
n=list(map(int,input.split()))
for i in range(len(n)):
  if(n[i]==0):
    cout<<i+1
    break
Problem p02684 (python)

Fixed submission:
from collections import defaultdict

N, K = map(int, input().split())
A = list(map(int, input().split()))

d = defaultdict(list)

p = 1
root = []

#s, e = 0, 0

for i in range(K):
    d[p].append(i)
    root.append(p)
    if len(d[p]) == 2:
        s = d[p][0]
        e = i
        n = (K - s) % (e - s)
        p = root[s + n]
        break
    p = A[p - 1]
#print(s, e)

#print(root)

#n = (K - s) % (e - s)
print(p)

Buggy submission (verdict: Runtime Error):
from collections import defaultdict

N, K = map(int, input().split())
A = list(map(int, input().split()))

d = defaultdict(list)

p = 1
root = [p]

s, e = 0, 0

for i in range(K):
    d[p].append(i)
    if len(d[p]) == 2:
        s = d[p][0]
        e = i
        break
    root.append(A[p - 1])
    p = A[p - 1]
#print(s, e)

#print(root)

n = (K - s) % (e - s)
print(root[s + n])

Buggy submission (verdict: Runtime Error):
from collections import defaultdict

N, K = map(int, input().split())
A = list(map(int, input().split()))

d = defaultdict(list)
root = []
p = 1

s, e = 0, 0

for i in range(K):
    d[p].append(i)
    root.append(A[p - 1])
    if len(d[p]) == 2:
        s = d[p][0]
        e = i
        break
    p = A[p - 1]
#print(s, e)

#print(root)

n = (K - s) % (e - s)
#print(n)
print(root[s + n - 1])

Buggy submission (verdict: Runtime Error):
from collections import defaultdict

N, K = map(int, input().split())
A = list(map(int, input().split()))

d = defaultdict(list)
root = []
p = 1

s, e = 0, 0

for i in range(10):
    d[p].append(i)
    root.append(A[p - 1])
    if len(d[p]) == 2:
        s = d[p][0]
        e = i
        break
    p = A[p - 1]
#print(s, e)

#print(root)

n = (K - s) % (e - s)
#print(n)
print(root[s + n - 1])
Problem p02690 (python)

Fixed submission:
X = int(input())

A = []
for i in range(1000):
    A.append(i ** 5)

x, y = 0, 0

flag = False
for i, a in enumerate(A):
    for j, b in enumerate(A[i+1:]):
        if b - a == X:
            flag = True
            x = j + i + 1
            y = i
            break
        if a + b == X:
            flag = True
            x = i
            y = -(j + i + 1)
            break
    if flag:
        break
print(x, y)

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

A = 1
while True:
    b = (A ** 5 - X)
    c = abs(b) / b
    B = abs(b) ** (0.2)
    if int(B) == B:
        break
    A += 1
print(A, int(c * B))
Problem p02691 (python)

Fixed submission:
from collections import defaultdict
N = int(input())
A = list(map(int, input().split()))
ai = defaultdict(int)
aj = defaultdict(int)

for i, a in enumerate(A):
    ai[i + 1 + a] += 1
    aj[i + 1 - a] += 1

ans = 0
for k, v in ai.items():
    ans += v * aj[k]
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
A = np.array(list(map(int, input().split())))
A = A.reshape(-1, 1)
B = A + A.T - np.arange(1, N+1) + np.arange(1, N+1).reshape(-1, 1)
print(np.sum(B == 0))
Problem p02719 (python)

Fixed submission:
import numpy as np
N, K = map(int, input().split())
a = N % K
b = K - a
print(min([a, b]))

Buggy submission (verdict: Runtime Error):
import numpy as np
N, K = map(int, input().split())
n = N
while 1:
	a = np.minumum(n, np.abs(n - K))
	if a == n:
		break
print(a)
Problem p02842 (python)

Fixed submission:
import numpy as np
N = int(input())

x = N / 1.08
c = int(np.ceil(x))
f = int(np.floor(x))
if int(c * 1.08) == N:
  print(c)
elif int(f * 1.08) == N:
  print(f)
else:
  print(':(')

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

x = N / 1.08
c = int(np.ceil(x))
f = int(np.floor(x))
if int(c * 1.08) == N:
  print(c)
elif int(f * 1.08) == N:
  print(f)
else:
  print(':('
Problem p02911 (python)

Fixed submission:
from collections import defaultdict

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

base = K - Q

d = defaultdict(int)
for a in A:
    d[a] += 1

for i in range(N): 
    if base > 0:
        print('Yes')
    else:
        n = i + 1
        if base + d[n] > 0:
            print('Yes')
        else:
            print('No')

Buggy submission (verdict: Runtime Error):
import numpy as np
N, K, Q = map(int, input().split())
A = np.array([int(input()) for _ in range(Q)])

base = K - Q

u, counts = np.unique(A, return_counts=True)

for i in range(N): 
    if base > 0:
        print('Yes')
    else:
        n = i + 1
        if n in u:
            if base + counts[u == n] > 0:
                print('Yes')
            else:
                print('No')
        else:
            print('No')
Problem p02995 (python)

Fixed submission:
import fractions
A, B, C, D = map(int, input().split())

E = (C * D) // fractions.gcd(C, D)

c = B // C - (A - 1) // C 
d = B // D - (A - 1) // D 
e = B // E - (A - 1) // E
ans = B - A - c - d + e + 1
print(ans)

Buggy submission (verdict: Runtime Error):
import math
A, B, C, D = map(int, input().split())

E = (C * D) // math.gcd(C, D)

c = B // C - (A - 1) // C 
d = B // D - (A - 1) // D 
e = B // E - (A - 1) // E
ans = B - A - c - d + e + 1
print(ans)
Problem p03037 (python)

Fixed submission:
N, M = map(int, input().split())
LR = [list(map(int, input().split())) for _ in range(M)]

card_min = 0
card_max = N
ans = N
#print(card_min, card_max)
for l, r in LR:
    if l > card_min:
        card_min = l
    if r < card_max:
        card_max = r
    #print(card_min, card_max)
    ans = card_max - card_min + 1
    if ans <= 0:
        ans = 0
        break
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
N, M = map(int, input().split())
LR = [list(map(int, input().split())) for _ in range(M)]

card = np.array([i+1 for i in range(N)])

for l, r in LR:
    card = card[(card >= l) & (card <= r)]
    if len(card) == 0:
        break
print(len(card))
Problem p03043 (python)

Fixed submission:
import numpy as np

N, K = map(int, input().split())

p1 = max(N - K + 1, 0) / N
p2 = 0.
l2K = np.log2(K)
for k in range(1, min(K, N+1)):
    p2 += (0.5) ** np.ceil(l2K - np.log2(k))

print(p1 + p2 / N)

Buggy submission (verdict: Runtime Error):
import math

N, K = map(int, input().split())

p1 = max(N - K + 1, 0) / N
p2 = 0.
l2K = math.log2(K)
for k in range(1, min(K, N+1)):
    p2 += (1 / N) * (0.5) ** int(l2K - math.log2(k) + 1)

print(p1 + p2)