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

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

I am sorry for seeming desperate.. but that's because I am.. I haven't been able to sleep because of this problem.. Any help is much appreciated.. This is regarding the problem D of CF Round 1044.. "Chicken Jockey".. I don't need you to validate my code.. just let me know why my approach would be wrong.. Please read the question before moving forward.. thank you..

Question

2133D - Chicken Jockey

My Approach

So what I'm trying to do is take a baseline value of the answer and store it in the sum.. the baseline value is what we would get if we keep killing the bottommost mob.. Now the actual answer can only be less than this.. how you may ask?? by breaking off mobs from the middle.. So now I create a new array "val" which stores how much I'd benefit if i killed the mob at that index.. I store this in negative so that I may add it to my baseline answer and reduce it.. So now obviously it's better to take as many negatives as possible.. except in the case where we have continuous negative values.. in that case what I do is I find the minimum subsequence sum of alternating elements..(there's only two.. so whatever the minimum value among those is.. that's what my "fun()" function is for) and then add it up to sum.. That's it.. that's my approach...

I have analysed the solution in the editorial.. I have tried to connect it to my solution.. It should be correct but I don't know what's wrong... It doesn't make any sense.. This never happens with me.. I am losing my mind.. Please help me stop losing my mind.. I might go crazy soon.. It's been days like this. Thank you.

My code just for reference: 335715833

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

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

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

I want to start off by saying that I don't know the solution to this. I wanted to start a discussion from others about what ideas they have to solve it. Also I couldn't find about this anywhere else on the internet so thats why I'm asking this here. Please don't be mad at me if its a bad question.

So there's the 0/1 knapsack problem where you maximize the profit. Thats cool but theres only one sack. What if theres more than one sack? Everything else is the same. A bunch of objects with some weight and profit, bags with some weight limit (all bags have same weight limit), and you can only, either take an object or leave it. You can't break it up into different bags or only take fractions of it or anything like that.

Any ideas are welcome.

The only approach I can think of is just try out all the permutations of the object list and insert them ony by one into the bags till they fill up then move on to the next bag.

If this problem is too difficult you can also assume that profit from all objects is the same ,i.e., one. (I added this constraint because I came across a problem somewhere and that perfectly fit into this type of problem where profit from all objects was same. That's how i started wondering about this topic).

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

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

Автор mrinmoy_2003, история, 3 года назад, По-английски

What i wanna do?

Copy code from my editor, go to 'SUBMIT' tab, paste it, click Submit button.

Whats the problem?

I don't wanna use my mouse or my touchpad to do this. I can go upto pasting the source code by pressing 'Tab' (It goes to the next interact-able item on a webpage), but once there 'Tab' just adds space in my code, it doesn't select the 'Submit' button. I have to use my mouse for that.

Solutions?

I was wondering if its possible to add a shortcut to press the submit button via a custom made extension. Is it? Or in any other way?

Why I wanna do it?

Because it would make me feel cooler.

Relevant Info maybe:

I'm running Ubuntu on a lenovo laptop. I use brave and firefox.

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

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