Editorial for MIDTERM
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.
Với bài này ta sẽ xử dụng kĩ thuật chặt nhị phân trên đáp án. Gọi mid là đoạn từ 1 đến \(mid\) đang
xét. Ta sẽ kiểm tra xem từ ngày 1 đến \(mid\) có đủ \(M\) môn được tổ chức hay không. Sau đó ta sẽ
tham gia các kì thi mà được tổ chức trễ nhất. Tiếp theo ta chỉ cần đếm số ngày trống và gặp môn
nào sẽ thi môn đó. Nếu không đủ số ngày để thi thì sẽ không thỏa.
Comments