Блог пользователя pista_chios

Автор pista_chios, история, 9 месяцев назад, По-английски

Given counts of A,B,C, we need to form the lexicographically smallest string using all A, B, C such that no three consecutive characters are identical. It is guaranteed that one can always form a valid string. The backtracking solution is trivial however how can we do it given the constraints?

0<=(A+B+C)<=10^5

Полный текст и комментарии »

  • Проголосовать: нравится
  • -3
  • Проголосовать: не нравится