Editorial for CJ thanh toán BALLAS


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.

Mình xin chia sẻ lời giải bài này :

  • Ý tưởng của bài này là sự kết hợp của bài BFS Cơ bản và truy vết. Nhưng trước tiên ta phải sắp xếp lại thứ tự đỉnh kể theo thứ tự tăng dần để đảm bảo đường đi in ra theo thứ tự từ điển

Như vậy là bài toán đã được giải quyết xong, các bạn có thể tham khảo code tại đây: Link



Comments

There are no comments at the moment.