Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
alst = list(map(int, input().split()))
plus = []
zero = []
minus = []
for a in alst:
    if a > 0:
        plus.append(a)
    elif a == 0:
        zero.append(a)
    else:
        minus.append(-1 * a)
p = len(plus)
z = len(zero)
m = len(minus)
p_cnt = p * (p - 1) // 2 + m * (m - 1) // 2
z_cnt = p * z + m * z + z * (z - 1) // 2
m_cnt = p * m
minus.sort()
plus.sort()
if m_cnt >= k: # 答えがマイナス
    l = 0
    r = 10 ** 20
    while r - l > 1:
        num = (r + l) // 2
        p_pos = p - 1
        cnt = 0
        for m_pos in range(m):
            while minus[m_pos] * plus[p_pos] >= num and p_pos >= 0:
                p_pos -= 1
            cnt += p - p_pos - 1
        if cnt >= k:
            l = num
        else:
            r = num
    ans = l * -1
elif m_cnt + z_cnt >= k: # 答えがゼロ
    ans = 0

else: # 答えがプラス
    k -= (z_cnt + m_cnt)
    l = 0
    r = 10 ** 20
    while r - l > 1:
        num = (r + l) // 2
        m_r = m - 1
        cnt = 0
        cnt_sub = 0
        for m_l in range(m):
            while minus[m_l] * minus[m_r] > num and m_r >= 0:
                m_r -= 1
            cnt += m_r + 1
            if minus[m_l] * minus[m_l] <= num:
                cnt -= 1
        p_r = p - 1
        for p_l in range(p):
            while plus[p_l] * plus[p_r] > num and p_r >= 0:
                p_r -= 1
            cnt += p_r + 1
            if plus[p_l] * plus[p_l] <= num:
                cnt -= 1
        cnt //= 2
        if cnt >= k:
            r = num
        else:
            l = num
    ans = r
print(ans)

Fixed submission:
n, k = map(int, input().split())
alst = list(map(int, input().split()))
plus = []
zero = []
minus = []
for a in alst:
    if a > 0:
        plus.append(a)
    elif a == 0:
        zero.append(a)
    else:
        minus.append(-1 * a)
p = len(plus)
z = len(zero)
m = len(minus)
p_cnt = p * (p - 1) // 2 + m * (m - 1) // 2
z_cnt = p * z + m * z + z * (z - 1) // 2
m_cnt = p * m
minus.sort()
plus.sort()
if m_cnt >= k: # 答えがマイナス
    l = 0
    r = 10 ** 20
    while r - l > 1:
        num = (r + l) // 2
        p_pos = p - 1
        cnt = 0
        for m_pos in range(m):
            while minus[m_pos] * plus[p_pos] >= num and p_pos >= 0:
                p_pos -= 1
            cnt += p - p_pos - 1
        if cnt >= k:
            l = num
        else:
            r = num
    ans = l * -1
elif m_cnt + z_cnt >= k: # 答えがゼロ
    ans = 0

else: # 答えがプラス
    k -= (z_cnt + m_cnt)
    l = 0
    r = 10 ** 20
    while r - l > 1:
        num = (r + l) // 2
        m_r = m - 1
        cnt = 0
        cnt_sub = 0
        for m_l in range(m):
            while minus[m_l] * minus[m_r] > num and m_r >= 0:
                m_r -= 1
            cnt += m_r + 1
            if minus[m_l] * minus[m_l] <= num:
                cnt -= 1
        p_r = p - 1
        for p_l in range(p):
            while plus[p_l] * plus[p_r] > num and p_r >= 0:
                p_r -= 1
            cnt += p_r + 1
            if plus[p_l] * plus[p_l] <= num:
                cnt -= 1
        cnt //= 2
        if cnt >= k:
            r = num
        else:
            l = num
    ans = r
print(ans)