Editorial for Kaninho với bài toán bật tắt bóng đèn


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.

Hint: Bóng đèn \(n\) bị đổi ở những thao tác \(i\) nào?

Bóng đèn \(n\) được thay đổi ở những thao tác mà \(n\) chia hết cho \(i\). Ta có thể kiểm tra với mọi \(i\) từ 1 đến \(n\) và cập nhật trạng thái của nó.



Comments

There are no comments at the moment.