Editorial for REPLACESUM
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.
Subtask 1: 50% test có
- Có thể sort vector hoặc mảng lại để kiếm
phần tử nhỏ nhất. - Độ phức tạp là
.
Subtask 2: 50% test còn lại không ràng buộc gì thêm.
- Các bạn có thể sử dụng CTDL đặc biệt như multiset hoặc priority queue để giải quyết đơn giản bài toán này.
- Chỉ mất
cho mỗi thao tác.
Comments