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

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

I was solving a problem and it led to a sub problem which goes like:

given 10^9>=A,B>0, minimise: 2*x+B%(A+x) , x>=0

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

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

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

Consider a matrix of size n, consisting of lower case aplhabets. We are required to find lexicographically smallest string starting from (1,1) and ending at (n,n).From any cell (i,j) we can either go right or down.

Now it is easily solvable in O(n^3) time ans space , but it is required to solve it in O(n^2) both time and space. Any help is appreciated

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

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