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

Автор asterisks, история, 5 лет назад, По-английски

Getting wrong answer on test 2 for the following problem. 1633D - Make Them Equal

My Code 144774883 Please Help.

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

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +4 Проголосовать: не нравится

Auto comment: topic has been updated by asterisks (previous revision, new revision, compare).

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I don't even understand properly your code, like there are many macros and that stuff but I'm pretty sure that there is no knapsack in there, and that was the intended way to solve it.

»
5 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

Your function for finding min no of opeartion to covert ('1' to 'm') is wrong . For m = 31 , you are getting minimum no of steps/operations as '7' but the minimum no of steps for m = '31' is '6' .

Edit :- Here is how you get 31 — [ 1 --> 2 --> 4 --> 8 --> 16 --> 21 --> 31 ] ( in 6 steps )

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -9 Проголосовать: не нравится