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

Fixed submission:
from sys import stdin,stdout
LI=lambda:list(map(int,input().split()))
MAP=lambda:map(int,input().split())
IN=lambda:int(input())
S=lambda:input()
import math
from collections import Counter,defaultdict

d=defaultdict(int)
m=10**6+1
sieve=[-1]*m
n=IN()
a=sorted(LI())
for i in a:
    if d[i]==0:
        d[i]+=1
        for j in range(2*i,m,i):
            sieve[j]=1
    else:
        sieve[i]=1
ans=0
for i in a:
    if sieve[i]==-1:
        ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
from sys import stdin,stdout
LI=lambda:list(map(int,input().split()))
MAP=lambda:map(int,input().split())
IN=lambda:int(input())
S=lambda:input()
import math
from collections import Counter,defaultdict

d=defaultdict(int)
m=10**6
sieve=[-1]*10**6
n=IN()
a=LI()
for i in range(n):
    d[a[i]]+=1
    for j in range(2*a[i],m,a[i]):
        sieve[j]=1
ans=0
for i in a:
    if sieve[i]==-1 and d[i]==1:
        ans+=1
print(ans)
Problem p02718 (python)

Fixed submission:
n,m = map(int,input().split())
A = list(map(int,input().split()))
A.sort(reverse=True)
if A[m-1]<sum(A)/4/m:
    print('No')
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
A = list(map(int,input().split()))
A.sort(reverse=True)
if A[m]<sum(A)/4/m:
    print('No')
else:
    print('Yes')
Problem p02683 (python)

Fixed submission:
N,M,X=map(int,input().split())
C=[list(map(int,input().split())) for i in range(N)]
INF=float("inf")
ans=INF

for i in range(1,2**N):
    skills=[0]*M
    total_cost=0
    for j in range(N):
        if ((i>>j)&1):
            total_cost+=C[j][0]
            for k in range(M):
                skills[k]+=C[j][k+1]
    if min(skills)>=X:
        ans=min(ans,total_cost)
        
print(ans if ans != INF else -1)

Buggy submission (verdict: Runtime Error):
M,N,X=map(int,input().split())
C=[list(map(int,input().split())) for i in range(N)]
INF=float("inf")
ans=INF

for i in range(1,2**N):
    skills=[0]*M
    total_cost=0
    for j in range(N):
        if ((i>>j)&1):
            total_cost+=C[j][0]
            for k in range(M):
                skills[k]+=C[j][k+1]
    if min(skills)>=X:
        ans=min(ans,total_cost)
        
print(ans if ans != INF else -1)
Problem p02727 (python)

Fixed submission:
X,Y,A,B,C=map(int,input().split())
R=sorted(list(map(int,input().split())),reverse=True)
G=sorted(list(map(int,input().split())),reverse=True)
RG=sorted(list(map(int,input().split())),reverse=True)


d=R[:X]+G[:Y]+RG
d.sort(reverse=True)
 
print(sum(d[:X+Y]))

Buggy submission (verdict: Runtime Error):
X,Y,A,B,C=map(int,input().split())
red=sorted(list(map(int,input().split())),reverse=True)
green=sorted(list(map(int,input().split())),reverse=True)
nocolor=sorted(list(map(int,input().split())),reverse=True)

X_cnt=0
Y_cnt=0
ans=[]

for i in range(X):
    ans.append(red[i])
    X_cnt+=1
    if X_cnt==X:
        break
    elif X_cnt<X:
        continue
for i in range(Y):
    ans.append(green[i])
    Y_cnt+=1
    if Y_cnt==Y:
        break
    elif Y_cnt<Y:
        continue

ans=sorted(ans)
ans_sum=sum(ans)    
for i in range(C):
    if ans[i]<nocolor[i]:
        ans_sum=ans_sum+nocolor[i]-ans[i]
        
print(ans_sum)

Buggy submission (verdict: Runtime Error):
X,Y,A,B,C=map(int,input().split())
red=sorted(list(map(int,input().split())),reverse=True)
green=sorted(list(map(int,input().split())),reverse=True)
nocolor=sorted(list(map(int,input().split())),reverse=True)

X_cnt=0
Y_cnt=0
ans=[]

for i in range(X):
    ans.append(red[i])
    X_cnt+=1
    if X_cnt==X:
        break
    elif X_cnt<X:
        continue
for i in range(Y):
    ans.append(green[i])
    Y_cnt+=1
    if Y_cnt==Y:
        break
    elif Y_cnt<Y:
        continue

ans=sorted(ans)
ans_sum=sum(ans)    
for i in range(C):
    if ans[i]<nocolor[i]:
        ans_sum=ans_sum_nocolor[i]-ans[i]
        
print(ans_sum)
Problem p02743 (python)

Fixed submission:
a,b,c=map(int,input().split())
print("Yes" if 4*a*b-(c-a-b)**2<0 and c-a-b>0 else "No")

Buggy submission (verdict: Runtime Error):
import sympy

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

r_ab=sympy.sqrt(a*b)

print("Yes" if a+b+2*r_ab -c <0 else "No")
Problem p02861 (python)

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

total_d=0
for i in range(N):
    for j in range(i):
        total_d+=((X[i][0]-X[j][0])**2+(X[i][1]-X[j][1])**2)**0.5
ans=total_d*2/N
print(ans)

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

total_d=0
for i in range(N):
    for j in range(i):
        total_d+=((X[i][0]-X[j][0])**2+(X[i][1]-X[j][1])**2)**0.5
ans=total_d*2/N
print(ans)
Problem p02995 (python)

Fixed submission:
from fractions import gcd
def lcm(a,b):
    return (a * b) // gcd(a, b)

A,B,C,D=map(int,input().split())

E=lcm(C,D)

num_C=B//C-(A-1)//C
num_D=B//D-(A-1)//D
num_CD=B//E-(A-1)//E

ans=(B-A+1)-(num_C+num_D-num_CD)
print(ans)

Buggy submission (verdict: Runtime Error):
from fractions import gcd
def lcm(a,b):
    return (a * b) // math.gcd(a, b)

A,B,C,D=map(int,input().split())

E=lcm(C,D)

num_C=B//C-(A-1)//C
num_D=B//D-(A-1)//D
num_CD=B//E-(A-1)//E

ans=(B-A+1)-(num_C+num_D-num_CD)
print(ans)

Buggy submission (verdict: Runtime Error):
import math
def lcm(a,b):
    return (a * b) // math.gcd(a, b)

A,B,C,D=map(int,input().split())
E=lcm(C,D)

num_C=B//C-(A-1)//C
num_D=B//D-(A-1)//D
num_CD=B//E-(A-1)//E

ans=(B-A+1)-(num_C+num_D-num_CD)
print(ans)
Problem p03220 (python)

Fixed submission:
N=int(input())
T,A=map(int,input().split())
H=list(map(int,input().split()))
INF=float('inf')
ans=[INF,INF]

for i in range(N):
    if ans[1]> abs(A-(T-H[i]*0.006)):
        ans[0]=i+1
        ans[1]=abs(A-(T-H[i]*0.006))
        
print(ans[0])

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

ans=[INF,INF]

for i in range(N):
    if ans[1]> abs(A-(T-H[i]*0.006)):
        ans[0]=i+1
        ans[1]=abs(A-(T-H[i]*0.006))
        
print(ans[0])
Problem p03238 (python)

Fixed submission:
N=int(input())
if N==1:
    print("Hello World")
else:
    a=int(input())
    b=int(input())
    print(a+b)

Buggy submission (verdict: Runtime Error):
N=int(input())
if N==1:
    print("Hello World")
else:
    a,b=map(int,input().split())
    print(a+b)
Problem p03292 (python)

Fixed submission:
A=sorted(list(map(int,input().split())))
print(A[2]-A[0])

Buggy submission (verdict: Runtime Error):
A=sorted(list(map(int,input())))
print(A[2]-A[0])
Problem p03385 (python)

Fixed submission:
S=set(input())
print("Yes" if len(S)==3 else "No")

Buggy submission (verdict: Runtime Error):
S=set(input())
print("Yes" len(S)==3 else "No")
Problem p03469 (python)

Fixed submission:
S=input()
print("2018"+S[4:])

Buggy submission (verdict: Runtime Error):
N,Y=map(int,input().split())
a=-1
b=-1
c=-1
for i in range(0,N+1):
    for j in range(0,N-i+1):
        if 10000*i+5000*j+1000*(N-i-j) == Y:
                a=i
                b=j
                c=N-i-j
print(a,b,c)
Problem p03555 (python)

Fixed submission:
S=input()
T=input()
print('YES' if S==T[::-1] else 'NO')

Buggy submission (verdict: Runtime Error):
S=input()
T=input()
pront('YES' if S==T[::-1] else 'NO')
Problem p04011 (python)

Fixed submission:
N=int(input())
K=int(input())
X=int(input())
Y=int(input())

if N-K>0:
    print(K*X+(N-K)*Y)
else:
    print(N*X)

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

if N-K>0:
    print(K*X+(N-K)*ren*Y)
else:
    print(N*X)
Problem p02645 (python)

Fixed submission:
print(input()[:3])

Buggy submission (verdict: Runtime Error):
print(input().split().index("0") + 1)
Problem p02765 (python)

Fixed submission:
n, r = map(int, (input().split()))
print(r + (100 * max(0, (10 - n))))

Buggy submission (verdict: Runtime Error):
n, r = map(int, (input().split()))
print(100 * max(0, (10 - n) + r)
Problem p03302 (python)

Fixed submission:
a, b = map(int, input().split())
if a + b == 15:
    print("+")
elif a * b == 15:
    print("*")
else:
    print("x")

Buggy submission (verdict: Runtime Error):
n, m, d = map(int, input().split())
if d != 0:
    print((2 * (n - d) * (m - 1)) / (n ** 2))
else:
    print((m - 1) / n)
Problem p03633 (python)

Fixed submission:
from functools import reduce
from fractions import gcd

n = int(input())
clocks = []
for i in range(n):
    clocks.append(int(input()))
print(reduce(lambda x, y: (x * y) // gcd(x, y), clocks))

Buggy submission (verdict: Runtime Error):
from functools import reduce
from math import gcd

n = int(input())
clocks = []
for i in range(n):
    clocks.append(int(input()))
print(reduce(lambda x, y: (x * y) // gcd(x, y), clocks))

Buggy submission (verdict: Runtime Error):
from functools import reduce
from math import gcd

n = int(input())
clocks = []
for i in range(n):
    clocks.append(int(input()))
print(reduce(lambda x, y: (x * y) // gcd(x, y), clocks, 1))
Problem p03680 (python)

Fixed submission:
n = int(input())
a = [int(input()) for i in range(n)]
counter = 0
i = 1
while counter <= n:
    i = a[i - 1]
    counter += 1
    if i == 2:
        print(counter)
        break
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
n = input()
a = (input() for i in range(n))
counter = 0
i = 1
while counter < n:
    i = a[i - 1]
    counter += 1
    if i == 2:
        print(counter)
        break
else:
    print(-1)
Problem p03759 (python)

Fixed submission:
a, b, c = map(int, input().split())
print("YES" if b - a == c - b else "NO")

Buggy submission (verdict: Runtime Error):
from string import ascii_lowercase

n = int(input())
ans_l = [100 for i in range(26)]

for i in range(n):
    s = str(input())
    for i, j in enumerate(ascii_lowercase):
        ans_l[i] = min(ans_l[i], s.count(j))
print("".join(i * j for i, j in zip(ascii_lowercase, ans_l)))
Problem p02640 (python)

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

result = 'No'
li = []
for i in range(X):
    li.append(4)
if sum(li) == Y:
    result = 'Yes'
else:
    for i in range(X):
        li[i] = 2
        if sum(li) == Y:
            result = 'Yes'
            break

print(result)

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

result = 'No'
li = []
for _ in range(X):
    li.append(2)
    if sum(li) == Y:
        result = 'Yes'
        break

for i in range(X):
    li[i] = 4
    if sum(li) == Y:
        result = 'Yes'
        break

print(result)
Problem p02767 (python)

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

minX = min(X)
maxX = max(X)
li = []
for i in range(100):
    temp = 0
    for j in range(N):
        temp += (X[j] - i)**2
    li.append(temp)

print(min(li))

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

minX = min(X)
maxX = max(X)
li = []
for i in range(minX, maxX):
    temp = 0
    for j in range(N):
        temp += (X[j] - i)**2
    li.append(temp)

print(min(li))
Problem p03214 (python)

Fixed submission:
import numpy as np
N = int(input())
a = list(map(int, input().split()))

avg = 0
for i in range(N):
    avg += a[i]
avg /= N

idx = np.abs(np.asarray(a)-avg).argmin()
print(idx)

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

avg = 0
for i in range(N):
    avg += a[i]
avg /= N

if round(avg) in a:
    print(a.index(round(avg)))
else:
    result = 100
    for i in range(N):
        temp = abs(avg-a[i])
        if temp <= result:
            result = temp
    print(a.index(round(result)))

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

avg = 0
for i in range(N):
    avg += a[i]
avg /= N

if round(avg) in a:
    print(a.index(round(avg)))
else:
    result = 100
    for i in range(N):
        temp = abs(a[i]-avg)
        if temp <= result:
            result = temp
    print(a.index(round(result)))

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

avg = 0
for i in range(N):
    avg += a[i]
avg /= N

if round(avg) in a:
    print(a.index(avg))
else:
    result = 100
    for i in range(N):
        temp = abs(a[i]-avg)
        if temp <= result:
            result = temp
    print(a.index(round(result)))

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

avg = 0
for i in range(N):
    avg += a[i]
avg /= N
result = 100

if round(avg) in a:
    print(a.index(avg))
else:
    for i in range(N):
        temp = abs(avg-a[i])
        if temp <= result:
            result = temp
    print(a.index(round(result)))

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

avg = 0
for i in range(N):
    avg += a[i]
avg /= N
result = 100

if avg in a:
    print(a.index(avg))
else:
    for i in range(N):
        temp = abs(avg-a[i])
        if temp <= result:
            result = temp
    print(a.index(round(result)))

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

avg = 0
for i in range(N):
    avg += a[i]
avg /= N
a = list(set(a))
result = 100


if avg in a:
    result = a.index(avg)
else:
    for i in range(len(a)):
        temp = abs(avg-a[i])
        if temp <= result:
            result = temp
    result = a.index(round(result))
print(result)
Problem p03220 (python)

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

ans = []
for i in range(N):
    ans.append(abs(A - (T - H[i] * 0.006)))

print(ans.index(min(ans))+1)

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

li = []
temp = 10 ** 5
for i in range(N):
    t = int(T - (H[i] * 0.006))
    li.append(t)
    if abs(A - t) < temp:
        temp = abs(A-t)

if A < 0:
    idx = li.index(-(temp-A))
else:
    idx = li.index(temp+A)

print(idx+1)

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

t = []
temp = 10 ** 5
for i in range(N):
    t.append(int(T - H[i] * 0.006))
    if abs(t[i] - A) <= temp:
        temp = abs(t[i] - A)

if A < 0:
    print(t.index((temp-A) * -1)+1)
else:
    print(t.index(temp+A)+1)
Problem p03284 (python)

Fixed submission:
N, K = map(int, input().split())
if N % K == 0:
  print(0)
else :
  l = [(N + i) // K for i in range(K)]
  print(max(l) - min(l))

Buggy submission (verdict: Runtime Error):
N, K = int(input().split())
if N % K == 0:
  print("0")
else :
  print("1")

Buggy submission (verdict: Runtime Error):
N, K = int(input().split())
if N % K == 0:
  print(0)
else :
  print(1)
Problem p03309 (python)

Fixed submission:
import statistics

N = int(input())
A = list(map(int, input().split()))
B = []
li = []
for i in range(N):
  B.append(A[i] - (i+1))
b = int(statistics.median(B))
for i in range(N):
  li.append(abs(A[i] - (b+i+1)))
print(sum(li))

Buggy submission (verdict: Runtime Error):
import collections

N = int(input())
A = list(map(int, input().split()))
li = []
b = 0
if max(A) > (sum(A) - max(A):
  b = -max(A)
  for i in range(N):
    li.append(abs(A[i]-(b+i+1)))
  print(sum(li))
else :
  for i in range(N):
    li.append(abs(A[i]-(b+i+1)))
  c = collections.Counter(li)
  b = -c.most_common()[0][0]
  li.clear()
  for i in range(N):
    li.append(abs(A[i]-(b+i+1)))
  print(sum(li))

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

N = int(input())
A = list(map(int, input().split()))
b = 0
li = []
for i in range(N):
  li.append(abs(A[i]-(b+i+1)))
if max(A) == N:  
  print(sum(li))
else :
  mode = max(li)
  mode = statistics.mode(li)
  b = -mode
  li.clear()
  for i in range(N):
    li.append(abs(A[i]-(b+i+1)))
  print(sum(li))

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

N = int(input())
A = list(map(int, input().split()))
b = 0
li = []
if max(A) == N:  
  for i in range(N):
    li.append(abs(A[i]-(b+i+1)))
  print(sum(li))
else :
  mode = max(li)
  mode = max(statistics.mode(li))
  b = -mode
  for i in range(N):
    li.append(abs(A[i]-(b+i+1)))
  print(sum(li))
Problem p03323 (python)

Fixed submission:
A, B = map(int, input().split())
if A <= 8 and B <= 8:
  print("Yay!")
else :
  print(":(")

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
if A <= 8 and B <= 8:
  print("Yay!")
elif 8 < A or B < 8:
  print(":(")
Problem p03328 (python)

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

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
dp = []
dp[0] = 1
dp[1] = 2
for i in range(1000):
  dp[i] = dp[0] + dp[1+i]
  print(dp[i])
Problem p03352 (python)

Fixed submission:
X = int(input())

result = 1
for b in range(1, 32):
    for p in range(2, X+1):
        if X >= b**p:
            result = max(result, b ** p)
print(result)

Buggy submission (verdict: Runtime Error):
X = int(input())
li = []
for i in range(1, X+1):
    for j in range(2, X+1):
        if X >= i**j:
            li.append(i**j)
print(max(li))
Problem p02612 (python)

Fixed submission:
N = int(input())
if N%1000==0:
  print(0)
else:
  print(1000-N%1000)

Buggy submission (verdict: Runtime Error):
if N%1000==0:
  print(0)
else:
  print(1000-N%1000)

Buggy submission (verdict: Runtime Error):
if N%1000==0:
  return 0
else:
  return 1000-N%1000

Buggy submission (verdict: Runtime Error):
if N%1000==0:
  return (0)
else:
  return (1000-N%1000)
Problem p02613 (python)

Fixed submission:
n=int(input())
d={"AC":0,"WA":0,"TLE":0,"RE":0}
for i in range(n):
  x=input()
  d[x]=d[x]+1
for k,v in d.items():
	print(k,"x",v)

Buggy submission (verdict: Runtime Error):
n=int(input("Test cases"))
d=dict()
for i in range(n):
  x=input("Enter result")
  if not x in d:
    d[x] = 1
  else:
    d[x]=d[x]+1
for k,v in d.items()
	print(k,"x",v)
Problem p02612 (python)

Fixed submission:
x=int(input())
if x%1000==0:
   print(0)
else :
  x=1000-x%1000
  print(x)

Buggy submission (verdict: Runtime Error):
x=input()
if x%1000:
  print('x')
else 
  x=1000-x
  print('x')
Problem p02628 (python)

Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))
p.sort()
total = 0
for i in range(k):
    total+=p[i]
print(total)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().sprit())
a = list(map(int, input().sprit()))
a.sort()
b = 0
for i in range(k):
	b+=a[i]
print(b)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().sprit())
a = list(map(int, input().sprit()))
a.sort()
b = 0
for i in range(k):
	b += a[i]
print(b)

Buggy submission (verdict: Runtime Error):
n, k = map(int,input().sprit())
a = list(map(int,input().sprit()))
a.sort()
b = 0
for i in range(k):
	b += a[k]
print(b)

Buggy submission (verdict: Runtime Error):
n, k = map(int,input().sprit())
a = list(map(int,input().sprit()))
a.sort()
b = 0
for i in range(k)
	b += a[k]
print(b)

Buggy submission (verdict: Runtime Error):
a = list(map(int,input().sprit()))
b = list(map(int,input().sprit()))
b.sort()
c = 0
for i in range(a[1])
	c += b[i]
print(c)

Buggy submission (verdict: Runtime Error):
a = list(map(int,input().sprit()))
for i in range(a[0])
	b =  list(map(int,input().sprit()))
b.sort()
c = 0
for i in range(a[1])
	c += b[i]
print(b)
Problem p02677 (python)

Fixed submission:
import math
a, b, h, m = map(int, input().split())
ang_a = (360 * h / 12) + (0.5 * m)
ang_b = 360 * m / 60
ang = abs(ang_a - ang_b if ang_a > ang_b else ang_b - ang_a)
ans = math.sqrt((a ** 2 + b ** 2) - (2*a*b*math.cos(math.radians(ang))))
print(ans)

Buggy submission (verdict: Runtime Error):
import math

a, b, h, m = map(int, input().split())
ang_a = 360 * h / 12
ang_b = 360 * m / 60
s_a = 0
s_b = 0

while ang_a - 90 > 0:
    ang_a -= 90
    s_a += 1
while ang_b - 90 > 0:
    ang_b -= 90
    s_b += 1


def ppp(xx, yy, s):
    if s == 0:
        return map(int, xx, yy)
    elif s == 1:
        return map(int, xx, -yy)
    elif s == 2:
        return map(int, -xx, -yy)
    elif s == 3:
        return map(int, -xx, yy)
    else:
        return map(int, [0, 0])


x_a = math.cos(ang_a)
y_a = math.sin(ang_a)
y_b = math.cos(ang_b)
x_b = math.sin(ang_b)

x_a, y_a = ppp(x_a, y_a, s_a)
x_b, y_b = ppp(x_b, y_b, s_b)
x = abs(x_a, x_b)
y = abs(y_a, y_b)
ans_r = math.sqrt(x) + math.sqrt(y)
ans = math.sqrt(ans_r)
print(ans)
Problem p03043 (python)

Fixed submission:
n, k = map(int, input().split())
p = 0
for i in range(1, n + 1):
    if i < k:
        count = 1
        while (i * (2 ** count)) < k:
            count += 1
        p += (1 / n) * (0.5 ** count)
    else:
        p += 1 / n
print(p)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
p = 0
for i in range(1, n + 1):
    if i < k:
        count = 1
        while i * count < k:
            count += 1
        p += 0.5 ^ float(count)
    else:
        p += 1
print(p/n)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
p = 0
for i in range(1, n + 1):
    if i < k:
        count = 1
        while i * count < k:
            count += 1
        p += 0.5 ^ count
    else:
        p += 1
print(p/n)
Problem p02612 (python)

Fixed submission:
input1 = input()
result = 1000 - int(input1) % 1000
if result == 1000:
    print(0)
else:
    print(result)

Buggy submission (verdict: Runtime Error):
input1 = input()
result = 1000 - int(input1) % 1000
if result == 1000:
    print 0
else:
    result

Buggy submission (verdict: Runtime Error):
input1 = input()
print 1000 - int(input1) % 1000

Buggy submission (verdict: Runtime Error):
raw_input = input
input1 = raw_input()
print 1000 - int(input1) % 1000

Buggy submission (verdict: Runtime Error):
input1 = raw_input()
print 1000 - int(input1) % 1000
Problem p02783 (python)

Fixed submission:
#!/usr/bin/env python3
H, A = map(int,input().split())
count=0
while H>0:
    count+=1
    H-=A
print(count)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
h,n = map(int,input().split())
a = list(map(int,input().split()))
sum=0
for i in a:
    sum+=i

if sum>=h:
    print("Yes")
else:
    print("No")
Problem p02612 (python)

Fixed submission:
yen = 1000-(int(input())%1000)
if yen == 1000:
    print(0)
else:
    print(yen)

Buggy submission (verdict: Runtime Error):
num = int(input())
ac = 0
wa = 0
tle = 0
re = 0
for i in range(num):
    word = input()
    if word == "AC":
        ac = ac + 1
    elif word == "WA":
        wa = wa + 1
    elif word == "TLE":
        tle = tle + 1
    elif word == "RE":
        re = re + 1
print("AC x ",ac)
print("WA x ",wa)
print("TLE x ",tle)
print("RE x ",re)
Problem p02658 (python)

Fixed submission:
n = int(input())
a = [int(_) for _ in input().split()]
a.sort()
ans = 1
for i in a:
    if i == 0:
        ans = 0
        break
    ans *= i
    if ans > 10**18:
        ans = -1
        break
 
print(ans)

Buggy submission (verdict: Runtime Error):
num = int(input())
nums = list(map(int,input().split()))
ans = 1
for i in range(num):
    if nums[i] == 0:
        ans = 0
if ans != 0:
    for j in nums:
        ans *= nums[j]
        if len(str(ans)) > 18:
            ans = -1
            break
print(ans)

Buggy submission (verdict: Runtime Error):
num = int(input())
nums = list(map(int,input().split()))
ans = 1
for i in range(num):
    if nums[i] == 0:
        ans = 0
if ans != 0:
    for j in nums:
        ans += nums[j]
        if len(str(ans)) > 18:
            ans = -1
            break
print(ans)
Problem p02677 (python)

Fixed submission:
import math

short,long,hour,min=map(int,input().split())
hour = 360 / 12 * hour + 360/12/60*min
min = 360 / 60 * min

rasian = abs(hour - min)

length = math.sqrt(short*short + long*long - 2*short*long*math.cos(math.radians(rasian)))

print(length)

Buggy submission (verdict: Runtime Error):
import math

short = int(input())
long = int(input())
hour = int(input())
min = int(input())

hour = 360 / 12 * hour + 360/12/60*min
min = 360 / 60 * min

rasian = abs(hour - min)

if rasian > 90:
    length = math.sqrt(short*short + long*long + 2*short*long*math.cos(math.radians(rasian)))
elif rasian < 90:
    length = math.sqrt(short*short + long*long - 2*short*long*math.cos(math.radians(rasian)))
else:
    length = math.sqrt(short*short + long*long)
print(length)