Help needed in parenthesis problem

Правка en2, от L_Drago_Destructor, 2023-02-04 23:57:40

I was solving national OI when I stumbled across this (simple?) problem which I was unable to solve.

"Given N and K find the k-th lexicographically correct parenthesis of length N".

Example:

N = 4 k = 2

()()

Thanks in advance! Hope this question will help somebody else too.

Теги brackets matching

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский L_Drago_Destructor 2023-02-04 23:58:35 0 (published)
en2 Английский L_Drago_Destructor 2023-02-04 23:57:40 2 Tiny change: '4 k = 2\n()()\n\n' -> '4 k = 2\n\n()()\n\n'
en1 Английский L_Drago_Destructor 2023-02-04 23:57:21 332 Initial revision (saved to drafts)