Editorial for Điểm gần thứ K
Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.
Submitting an official solution before solving the problem yourself is a bannable offence.
Author:
Biến đổi bài toán: Với hai số nguyên và
, tìm giá trị
nhỏ nhất thỏa mãn có ít nhất
phần tử của dãy
có giá trị nằm trong khoảng
. Từ đó, tiến hành sắp xếp mảng
và thực hiện Tìm kiếm nhị phân với mỗi truy vấn.
Độ phức tạp: với
.
Comments