Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import collections
n = int(input())
l = []
for i in range(n):
    s = str(input())
    l.append(s)
l = collections.Counter(l)
t = [kv[0] for kv in l.items() if kv[1] == max(l.values())]
t.sort()
for i in range(len(t)):
    print(t[i])

Fixed submission:
import collections
n = int(input())
l = []
for i in range(n):
    s = str(input())
    l.append(s)

l = collections.Counter(l)
x = max(l.values())
t = [kv[0] for kv in l.items() if kv[1] == x]
t.sort()

for i in range(len(t)):
    print(t[i])
Buggy python submission (verdict: Runtime Error):
n,k = map(int, input().split())
p = list(map(int, input().split()))
ans = 0

for i in range(n-k+1):
    if i==0:
        t=sum(p[0:k])
    else:
        t=t-p[i-1]+p[i+k-1]
    ans=max(ans,ts)

print((ans+k)/2)

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

for i in range(n-k+1):
    if i==0:
        t=sum(p[0:k])
    else:
        t=t-p[i-1]+p[i+k-1]
    ans=max(ans,t)

print((ans+k)/2)

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int, input().split())
p = list(map(int, input().split()))
ans = 0

for i in range(n-k+1):
    t = 0
    for j in range(k):
        t += p[i+j]
    else:
        if t > ans:
            ans = t

print((ans+k)/2)

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

for i in range(n-k+1):
    if i==0:
        t=sum(p[0:k])
    else:
        t=t-p[i-1]+p[i+k-1]
    ans=max(ans,t)

print((ans+k)/2)

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int, input().split())
p = list(map(int, input().split()))
ans = 0

for i in range(n-k+1):
    if sum(p[i:i+k]) > ans:
        ans = sum(p[i:i+k])

print((ans+k)/2)


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

for i in range(n-k+1):
    if i==0:
        t=sum(p[0:k])
    else:
        t=t-p[i-1]+p[i+k-1]
    ans=max(ans,t)

print((ans+k)/2)

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int, input().split())
p = list(map(int, input().split()))
ans = 0

for i in range(n-k+1):
    ans = max(ans, sum(p[i:i+k]))

print((ans+k)/2)


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

for i in range(n-k+1):
    if i==0:
        t=sum(p[0:k])
    else:
        t=t-p[i-1]+p[i+k-1]
    ans=max(ans,t)

print((ans+k)/2)
Buggy python submission (verdict: Time Limit Exceeded):
a = []
b = []
h, n = map(int, input().split())
for i in range(n):
    x, y = map(int, input().split())
    a.append(x)
    b.append(y)

dp = [float("inf")]*(h+1)
dp[0] = 0

for i in range(n):
    for j in range(h + 1):
        if j < a[i]:
            dp[j] = min(dp[j], b[i])
        else:
            dp[j] = min(dp[j], dp[j-a[i]]+b[i])

print(dp[h])

Fixed submission:
a = []
b = []
h, n = map(int, input().split())
for i in range(n):
    x, y = map(int, input().split())
    a.append(x)
    b.append(y)

dp = [float("inf")]*(h+1)
dp[0] = 0

for i in range(n):
    for j in range(h + 1):
        if j < a[i]:
            dp[j] = min(dp[j], b[i])
        else:
            dp[j] = min(dp[j], dp[j-a[i]]+b[i])

print(dp[h])
Buggy python submission (verdict: Runtime Error):
from sympy import nextprime
x = int(input())
print(nextprime(x-1))

Fixed submission:
x = int(input())
for i in range(x,10**5 +4):
    for p in range(2, int(x**(1/2)+1)):
        if i%p == 0 :
            break
    else:
        print(i)
        break
Buggy python submission (verdict: Runtime Error):
n = int(input())
ni = n%100
da = n//100

for a in range(ni):
    for b in range(ni):
        for c in range(ni):
            for d in range(ni):
                for e in range(ni):
                    if a + b*2 + c*3 + d*4 + e*5 == ni :
                        break
                else:
                    continue
                break
            else:
                continue
            break
        else:
            continue
        break
    else:
        continue
    break
if a+b+c+d+e <=da:
    print("1")
else:
    print("0")

Fixed submission:
n = int(input())
ni = n%100
da = n//100

if n < 100:
    print("0")
elif ni == 0:
    print("1")
else:
    for a in range(ni):
        for b in range(ni):
            for c in range(ni):
                for d in range(ni):
                    for e in range(ni):
                        if a + b*2 + c*3 + d*4 + e*5 == ni :
                            break
                    else:
                        continue
                    break
                else:
                    continue
                break
            else:
                continue
            break
        else:
            continue
        break
    if a+b+c+d+e <=da:
        print("1")
    else:
        print("0")
Buggy python submission (verdict: Runtime Error):
import math
from sympy import primerange
import sys
sys.setrecursionlimit(10**6) 
inn = n = int(input())
num = int(math.sqrt(n)) + 1
primlist = list(primerange(2,num)) 

for i in primlist:
    if inn % i == 0:
        while inn % num != 0:
            num -= 1
        else:
            print(num+ inn//num -2)
            break
        
else:
    print(inn-1)

Fixed submission:
n = int(input())
ans = 0
t = int(n**(1/2)+1)


for i in range(t, 0, -1):
    if n%i == 0:
        ans += i
        ans += n//i
        break

print(ans-2)

Buggy python submission (verdict: Runtime Error):
import math
from sympy import primerange
inn = n = int(input())
num = int(math.sqrt(n)) + 1
primlist = list(primerange(2,num)) 
for i in primlist:
    if inn % i == 0:
        while inn % num != 0:
            num -= 1
        else:
            print(num+ inn//num -2)
            break        
else:
    print(inn-1)

Fixed submission:
n = int(input())
ans = 0
t = int(n**(1/2)+1)


for i in range(t, 0, -1):
    if n%i == 0:
        ans += i
        ans += n//i
        break

print(ans-2)

Buggy python submission (verdict: Runtime Error):
import math
from sympy import primerange
inn = n = int(input())
num = int(math.sqrt(n)) + 1
primlist = list(primerange(2,num)) 

for i in primlist:
    if inn % i == 0:
        while inn % num != 0:
            num -= 1
        else:
            print(num+ inn//num -2)
            break
        
else:
    print(inn-1)

Fixed submission:
n = int(input())
ans = 0
t = int(n**(1/2)+1)


for i in range(t, 0, -1):
    if n%i == 0:
        ans += i
        ans += n//i
        break

print(ans-2)
Buggy python submission (verdict: Time Limit Exceeded):
n, k, q = map(int, input().split())
a  = [int(input()) for i in range(q)]
t = [k]*n
t = [n-1*q for n in t]

for i in range(q):
    for j in range(n):
        if a[i] == j:
            t[j-1] += 1
            break

for i in range(n):
    if t[i] >0:
        print("Yes")
    else:
        print("No")


Fixed submission:
n, k, q = map(int, input().split())
a  = [int(input()) for i in range(q)]
t = [k]*n
t = [n-1*q for n in t]

for i in range(q):
    t[a[i]-1] +=1

for i in range(n):
    if t[i] >0:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n, d = map(int, input().split())
a = list(map(int, input().split()))

for i in range(d):
    t = a.index(max(a))
    a[t] //= 2
    if max(a) == 0:
        break
print(sum(a))

Fixed submission:
import heapq
n, d = map(int, input().split())
a = list(map(lambda x: int(x)*(-1), input().split()))
heapq.heapify(a)

for _ in range(d):
    t = heapq.heappop(a)
    heapq.heappush(a, (-1)*(-t//2))

print(-sum(a))

Buggy python submission (verdict: Time Limit Exceeded):
n, d = map(int, input().split())
a = list(map(int, input().split()))
c = 0
while c != d:
    c += 1
    t = a.index(max(a))
    a[t] = max(a)//2
    if max(a) == 0:
        print(sum(a))
        quit()
else:
    print(sum(a))

Fixed submission:
import heapq
n, d = map(int, input().split())
a = list(map(lambda x: int(x)*(-1), input().split()))
heapq.heapify(a)

for _ in range(d):
    t = heapq.heappop(a)
    heapq.heappush(a, (-1)*(-t//2))

print(-sum(a))

Buggy python submission (verdict: Time Limit Exceeded):
n, d = map(int, input().split())
a = list(map(int, input().split()))

for i in range(d):
    t = a.index(max(a))
    a[t] = max(a)//2
    if max(a) == 0:
        break
print(sum(a))

Fixed submission:
import heapq
n, d = map(int, input().split())
a = list(map(lambda x: int(x)*(-1), input().split()))
heapq.heapify(a)

for _ in range(d):
    t = heapq.heappop(a)
    heapq.heappush(a, (-1)*(-t//2))

print(-sum(a))

Buggy python submission (verdict: Time Limit Exceeded):
n, d = map(int, input().split())
a = list(map(int, input().split()))

for i in range(d):
    t = a.index(max(a))
    a[t] = a[t]//2
    if max(a) == 0:
        break
print(sum(a))

Fixed submission:
import heapq
n, d = map(int, input().split())
a = list(map(lambda x: int(x)*(-1), input().split()))
heapq.heapify(a)

for _ in range(d):
    t = heapq.heappop(a)
    heapq.heappush(a, (-1)*(-t//2))

print(-sum(a))
Buggy python submission (verdict: Runtime Error):
    n = int(input())
    print(n**3)

Fixed submission:
n = int(input())
print(n**3)
Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))

if h[-2] - h[-1] >1:
    print("No")

else:
    for i in range(1,n-1):
        l = h[-(2+i)]
        r = h[-(1+i)]
        if l - r < -1:
            print("No")
            break
    else:
        print("Yes")

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

for i in range(0,n-1):
    l = h[-(2+i)]
    r = h[-(1+i)]
    if l - r == 1:
        h[-(2+i)] = l-1
    elif l - r > 1 :
        print("No")
        break
else:
    print("Yes")

Buggy python submission (verdict: Runtime Error):
if h[-2] - h[-1] >1:
    print("No")

else:
    for i in range(1,n-1):
        l = h[-(2+i)]
        r = h[-(1+i)]
        if l - r < -1:
            print("No")
            break
    else:
        print("Yes")

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

for i in range(0,n-1):
    l = h[-(2+i)]
    r = h[-(1+i)]
    if l - r == 1:
        h[-(2+i)] = l-1
    elif l - r > 1 :
        print("No")
        break
else:
    print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
n = int(input())
d = deque([int(input()) for i in range(n)])

for _ in range(n):
    x = d.popleft()
    print(max(d))
    d.append(x)

Fixed submission:
n = int(input())
t = [int(input()) for i in range(n)]
tt = sorted(t)
m = tt[-1]
mm = tt[-2]

for i in range(n):
    if t[i] == m:
        print(mm)
    else:
        print(m)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
t = [int(input()) for i in range(n)]

for i in range(n):
    a = t[i]
    del t[i]
    print(max(t))
    t.insert(i,a)

Fixed submission:
n = int(input())
t = [int(input()) for i in range(n)]
tt = sorted(t)
m = tt[-1]
mm = tt[-2]

for i in range(n):
    if t[i] == m:
        print(mm)
    else:
        print(m)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
t = [int(input()) for i in range(n)]

for i in range(n):
    a = t.pop(i)
    print(max(t))
    t.insert(i,a)

Fixed submission:
n = int(input())
t = [int(input()) for i in range(n)]
tt = sorted(t)
m = tt[-1]
mm = tt[-2]

for i in range(n):
    if t[i] == m:
        print(mm)
    else:
        print(m)
Buggy python submission (verdict: Runtime Error):
import math
a,b,c,d = map(int, input().split())

x = c*d/math.gcd(c,d)
A = (a-1) - (a-1)//c - (a-1)//d +x
B = b - (b-1)//c - (b-1)//d +x
print(int(B-A))

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

x = (c*d)//fractions.gcd(c,d)
A = (a-1) - (a-1)//c - (a-1)//d + (a-1)//x
B = b - b//c - b//d + b//x
print(int(B-A))
Buggy python submission (verdict: Runtime Error):
n,m = map(int, input().split())
a = []
for i in range(m):
    a.append(int(input()))

if a[0] == 1:
    x = [1,0]
else:
    x = [1,1]

for i in range(2,n+1):
    if i in a:
        x.append(0)

    else:
        x.append(x[i-1] + x[i-2])

if x[-1] == 0:
    print(0)
else:
    print(x[-1]%1000000007)

Fixed submission:
n,m = map(int, input().split())
a = [True]*(n+1)
for i in range(m):
    t = int(input())
    a[t] = False

x = [0]*(n+1)
x[0] = 1
if a[1]:
    x[1] = 1


for i in range(2, n+1):
    if a[i]:
        x[i] = x[i-1]+ x[i-2]
print(x[n]%1000000007)

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

if a[0] == 1:
    x = [1,0]
else:
    x = [1,1]

for i in range(2,n+1):
    if i in a:
        x.append(0)

    else:
        x.append(x[i-1] + x[i-2])

print(x[-1]%1000000007)

Fixed submission:
n,m = map(int, input().split())
a = [True]*(n+1)
for i in range(m):
    t = int(input())
    a[t] = False

x = [0]*(n+1)
x[0] = 1
if a[1]:
    x[1] = 1


for i in range(2, n+1):
    if a[i]:
        x[i] = x[i-1]+ x[i-2]
print(x[n]%1000000007)
Buggy python submission (verdict: Runtime Error):
l =[]
for i in range(5):
    a = int(input())
    l.append(a)

x =[]
j=[]
for i in l:
    t = i%10
    if t != 0:
        x.append(t)
        j.append(i+10-t)
    else:
        j.append(i)

print(sum(j)-10+min(x))

Fixed submission:
l =[]
for i in range(5):
    a = int(input())
    l.append(a)

x =[]
j=[]
for i in l:
    t = i%10
    if t != 0:
        x.append(t)
        j.append(i+10-t)
    else:
        j.append(i)

if len(x) == 0:
    print(sum(j))
else:
    print(sum(j)-10+min(x))
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
h = list(map(int, input().split()))

# n個の枠を作成
dp = [float("inf")] * n
# 初期値を0に
dp[0] = 0

#dp[i] =i番目まで来る最安の方法
for i in range(n):
    for j in range(1, min(i, k)+1):  # 上限が負にならないようにmin(i,k)で調整。+1でちゃんとrangeの癖を修正。
        dp[i] = min(dp[i], dp[i - j] + abs(h[i] - h[i - j]))

print(dp[-1])

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

dp = [float("inf")] * n
dp[0] = 0

for i in range(n):
    for j in range(0, min(i, k)+1):
        dp[i] = min(dp[i], dp[i - j] + abs(h[i] - h[i - j]))

print(dp[-1])
Buggy python submission (verdict: Time Limit Exceeded):
n, mw = map(int, input().split())
w = []
v = []

for i in range(n):
    ww, vv = map(int, input().split())
    w.append(ww)
    v.append(vv)

dp = [0] * (mw + 1)
for i in range(n):
    for j in range(mw, w[i] - 1, -1):
        dp[j] = max(dp[j], dp[j - w[i]] + v[i])

print(dp[mw])

Fixed submission:
n, mw = map(int, input().split())
w = []
v = []

for i in range(n):
    ww, vv = map(int, input().split())
    w.append(ww)
    v.append(vv)

dp = [[0] * (mw + 1) for i in range(n + 1)]

for i in range(n):
    for j in range(mw + 1):
        if j < w[i]:
            dp[i + 1][j] = dp[i][j]
        else:
            dp[i+1][j] = max(dp[i][j], dp[i][j-w[i]]+v[i])

print(dp[n][mw])

Buggy python submission (verdict: Time Limit Exceeded):
n, mw = map(int, input().split())
w = []
v = []

for i in range(n):
    ww, vv = map(int, input().split())
    w.append(ww)
    v.append(vv)

dp = [[0] * (mw + 1) for i in range(n + 1)]

for i in range(n):
    for j in range(mw + 1):
        if j < w[i]:
            dp[i + 1][j] = dp[i][j]
        else:
            dp[i+1][j] = max(dp[i][j], dp[i][j-w[i]]+v[i])

print(dp[n][mw])


Fixed submission:
n, mw = map(int, input().split())
w = []
v = []

for i in range(n):
    ww, vv = map(int, input().split())
    w.append(ww)
    v.append(vv)

dp = [[0] * (mw + 1) for i in range(n + 1)]

for i in range(n):
    for j in range(mw + 1):
        if j < w[i]:
            dp[i + 1][j] = dp[i][j]
        else:
            dp[i+1][j] = max(dp[i][j], dp[i][j-w[i]]+v[i])

print(dp[n][mw])
Buggy python submission (verdict: Runtime Error):
n, mw = map(int, input().split())
w = []
v = []

for i in range(n):
    ww, vv = map(int, input().split())
    w.append(ww)
    v.append(vv)

dp = [[0] * (mw + 1) for i in range(n + 1)]

for i in range(n):
    for j in range(mw + 1):
        if j < w[i]:
            dp[i + 1][j] = dp[i][j]
        else:
            dp[i+1][j] = max(dp[i][j], dp[i][j-w[i]]+v[i])

print(dp[n][mw])


Fixed submission:
n, mw = map(int, input().split())
w = []
v = []

for i in range(n):
    ww, vv = map(int, input().split())
    w.append(ww)
    v.append(vv)

dp = [[float("inf")] * (n*(10**3+1)) for i in range(n + 1)]
dp[0][0] = 0

for i in range(n):
    for j in range(n*1001):
        if j < v[i]:
            dp[i + 1][j] = dp[i][j]
        else:
            dp[i+1][j] = min(dp[i][j], dp[i][j-v[i]]+w[i])

for i in range(n * 1001):
    if dp[n][i] <= mw:
        ans = i

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(float, input().split()))
dp = [[0] * (n+1) for i in range(n+1)]
dp[0][0] = 1.0
for i in range(n):
    for j in range(0, i+1):
        dp[i + 1][j + 1] += dp[i][j] * p[i]
        dp[i+1][j] += dp[i][j]*(1-p[i])

ans = 0
for i in range((n + 1) // 2):
    ans += dp[n][i]

print(1-ans)


Fixed submission:
n = int(input())
p = list(map(float, input().split()))
dp = [[0] * (n+1) for i in range(n+1)]
dp[0][0] = 1.0
for i in range(n):
    for j in range(0, i+1):
        dp[i + 1][j + 1] += dp[i][j] * p[i]
        dp[i+1][j] += dp[i][j]*(1-p[i])

ans = 0
for i in range((n + 1) // 2):
    ans += dp[n][i]

print(1-ans)
Buggy python submission (verdict: Runtime Error):
import collections
n, k = map(int, input().split())
a = list(map(int, input().split()))
t = 0
ans = n

l = collections.Counter(a)
x = l.most_common(k)

for i in range(k):
    t += x[i][1]

ans -= t
if ans < 0:
    ans = 0
print(ans)


Fixed submission:
import collections
n, k = map(int, input().split())
a = list(map(int, input().split()))
t = 0
ans = n

l = collections.Counter(a)
x = l.most_common(k)

for i in range(len(x)):
    t += x[i][1]

ans -= t
if ans < 0:
    ans = 0
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split());print([1,0][a%b==0]))

Fixed submission:
a,b=map(int,input().split())
print(0 if a%b==0 else 1)
Buggy python submission (verdict: Runtime Error):
N = input()
if N % 2 == 0:
  print(N)
else:
  print(N*2)

Fixed submission:
N = int(input())
if N % 2 == 0:
    print(N)
else:
    print(N * 2)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
c = 0
list_s = [sorted(list(set(s[:i]))) for i in range(1,n)]
list_l = [sorted(list(set(s[i:]))) for i in range(1,n)]
print(max([sum([1 if list_s[j][i] in list_l[j] else 0 for i in range(len(list_s[j]))]) for j in range(n-1)]))

Fixed submission:
A,B = map(int,input().split())
sum = A + B
dif = A - B
pro = A * B
if sum > dif:
    if sum > pro:
        print(sum)
    else:
        print(pro)
elif dif > pro:
    print(dif)
else:
    print(pro)
Buggy python submission (verdict: Runtime Error):
x = int(input())
print(max([max([i**j for j in range(2,x) if x >= i**j]) for i in range(2,x) if i**2 <=x]))

Fixed submission:
a,b,c,d = map(int,input().split())
print( "Yes" if (abs(b-a) <=d and abs(c-b) <=d) or abs(c-a) <=d else "No")
Buggy python submission (verdict: Runtime Error):
n,x = map(int,input().split())
m = []
for i in range(n):
    m += map(int,input().split())
print(n + (x - sum(m)) // min(m))

Fixed submission:
S = list(input())
price = 700
for i in range(len(S)):
    if S[i] == "o":
        price += 100
print(price)

Buggy python submission (verdict: Runtime Error):
S = list(input())
price = 700
for i in S:
    if S[i] == "○":
        price += 100
print(price)

Fixed submission:
S = list(input())
price = 700
for i in range(len(S)):
    if S[i] == "o":
        price += 100
print(price)

Buggy python submission (verdict: Runtime Error):
S = list(input())
price = 700
for i in S:
    if S[i] == "○":
        price += 100
print(price)

Fixed submission:
S = list(input())
price = 700
for i in range(len(S)):
    if S[i] == "o":
        price += 100
print(price)
Buggy python submission (verdict: Runtime Error):
A,B,X = map(int,input().split())
print("Yes" if A < X and (A+B) > x else "No")

Fixed submission:
A,B,X = map(int,input().split())
print("YES" if A <= X <=(A+B) else "NO")
Buggy python submission (verdict: Runtime Error):
a, b = map(int,input().split())
s = input().split("-")
print("Yes" if len(s[0])==a and len(s[1])==b else "No")

Fixed submission:
print(24+(24-int(input())))

Buggy python submission (verdict: Runtime Error):
a, b = map(int,input().split())
s = input().split("-")
print("Yes" if len(s[0])==a and len(s[1])==b else "No")

Fixed submission:
print(24+(24-int(input())))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = list(map(int,input().split()))
count = 0
while len(set([i % 2 for i in s])) == 1:
    count += 1
    s = [i / 2 for i in s]
print(count)

Fixed submission:
input()
s=list(map(int,input().split()))
bl = 0
for i in s:
  bl |= i
print(len(bin(bl&-bl))-3)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = list(map(int,input().split()))
count = 0
while len(set(list(map(lambda x: x % 2, s)))) == 1:
    s = list(map(lambda x: x/2, s))
    count += 1
print(count)

Fixed submission:
input()
s=list(map(int,input().split()))
bl = 0
for i in s:
  bl |= i
print(len(bin(bl&-bl))-3)

Buggy python submission (verdict: Time Limit Exceeded):
count = 0
def check(xs):
    return list(map(lambda x: int(x / 2), xs))

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

while len(set(list(map(lambda x: x % 2, s)))) == 1:
    s = check(s)
    count += 1
print(count)

Fixed submission:
input()
s=list(map(int,input().split()))
bl = 0
for i in s:
  bl |= i
print(len(bin(bl&-bl))-3)
Buggy python submission (verdict: Runtime Error):
n, d = map(int, input().split())
x = []
y = []
cnt = 0

for i in range(n):
  x.append(int(input()))
  y.append(int(input()))

for j in range(n):
  l = (x[j] ** 2 + y[j] ** 2) ** (1 / 2)
  if l <= d:
    cnt += 1
  else:
    continue

print(cnt)

Fixed submission:
n, d = map(int, input().split())
lists = []
cnt = 0

for i in range(n):
  x, y = map(int, input().split())
  lists.append([x, y])
  

for j in range(n):
  l = (lists[j][0] ** 2 + lists[j][1] ** 2) ** (1 / 2)
  if l <= d:
    cnt += 1
  else:
    continue

print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):


a,b,c,x,y = map(int,input().split())
p_lists = []
#print(a,b,c,x,y)

if x > y:
  d = x
else:
  d = y

#print(d)

for i in range(x + 1):
    for j in range(y + 1):
        for k in range(2 * d + 1):
            if (i + k / 2 >= x and j + k / 2 >= y):
                price = a * i + b * j + c * k
                maxprice = a * x + b * y
                if price <= maxprice:
                    p_lists.append(price)      



#print(p_lists)
print(min(p_lists))


Fixed submission:



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

price = a * x + b * y


for i in range(max(x,y) + 1):
    ab = 2 * i
    cand = ab * c + a * max(0, x - i) + b * max(0, y-i)

    price = min(price, cand)

print(price)

Buggy python submission (verdict: Time Limit Exceeded):


a,b,c,x,y = map(int,input().split())
p_lists = []
#print(a,b,c,x,y)

if x > y:
  d = x
else:
  d = y

#print(d)

for i in range(x + 1):
    for j in range(y + 1):
        for k in range(2 * d + 1):
            if (i + k / 2 >= x and j + k / 2 >= y):
                price = a * i + b * j + c * k
                p_lists.append(price)      



#print(p_lists)
print(min(p_lists))


Fixed submission:



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

price = a * x + b * y


for i in range(max(x,y) + 1):
    ab = 2 * i
    cand = ab * c + a * max(0, x - i) + b * max(0, y-i)

    price = min(price, cand)

print(price)
Buggy python submission (verdict: Runtime Error):
n,d=map(int,input().split())

cnt=0
dist=0

for i in range(n){
  x,y=map(int,input().split())
  dist = x**2 + y**2
  if (dist <= d){
    cnt+=1
  }
}

print(cnt)

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

cnt=0
dist=0

for i in range(n):
  x,y=map(int,input().split())
  dist = x**2 + y**2
  if dist <= d**2:
    cnt+=1

print(cnt)