Editorial for Nhị phân 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:
Do ~n \le 20~, ta có thể duyệt đệ quy hoặc duyệt bitmask để sinh toàn bộ các xâu nhị phân có thể.
Với mỗi xâu nhị phân, cần kiểm tra xem đoạn các số ~1~ liên tiếp dài nhất có đúng bằng ~k~ hay không, nếu có thì xâu nhị phân đó là một xâu nhị phân thoả mãn.
Comments