Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "dp problem"
-
FML I am an idiot.. might end up in a rant here (well deserved!!) //if you are here reading this I'm so sorry again!!
I wrote to our support I need DP/HDMI cable.. they asked me to take a pic of the cable I'm currently using.. WTF?! Don't you know how connectors look?! Just get me the damn cable.. :/
Ok.. Took a picture.. sent it back.. At that time I still didn't see the problem with what I wrote/demanded..
Got back reply this is not HDMI connector... FML, I was so convinced computer had HDMI ports so even when I took the pic I wasn't paying attention.. Fuck.
And before when I was switching cables behind the computer below desk I was just blindly feeling around, it didn't even occurr to me to actually check what connectors are used..just knew both monitors had the same connector (and not aure why I thought HDMI :/)...so yeah, I'm the idiot who is not paying attention to stuff.. Fuck.. Was on a scavanger hunt for a wrong type of cable the whole time.. Sorry again!! And please don't kill me next time you see me.. o.O1 -
FOR FUCK'S SAKE
My verdict on display ports? From 1 to 10 10 being horrible as fuck I'd say it's about the same amount of times my fucking monitor went black and I almost had a siezure.
This may have nothing to do with programming but honestly, it fucking sucks. I've read so much online about how DP is better but no. I've never had a problem with HDMI, but HERE COMES ALONG THE MAGICAL DP. I was playing a FPS game and my left monitor went black over and over and I almost had a siezure. So I umplug the DP cable and my game fucking switches to my right monitor which is portrait mode, AND IT WASN'T EVEN SIDEWAYS GAMING... IT WAS PORTRAIT ON ONE FUCKING MONITOR... PORTRAIT.
I HAD TO PLAY THE REST OF THE GAME LIKE THAT. IN PORTRAIT MODE. THE DOOR FRAMES IN THE GAME WERE SO SKINNY IT LOOKED LIKE PAPER COULDN'T FIT THROUGH IT.10 -
Tldr:
Can't fucking figure out why I'm the only one who can't solve a DP problem in code, when me and friends use the same idea and no one knows why only mine doesn't work...
We are given a task to solve a problem using DP. My friends write their code with the same idea as a solution. Copying the code is not allowed. I follow the same idea but my code won't work. Others look into it, in case they find errors. They can't find any.
The problem (for reference):
Given a fixed list of int's a = (a_1,a_2,...,a_n) and b = (b_1,b_2,...,b_n), a_i and b_i >= 0, a.length == b.length
We want to maximize the sum of a_i's chosen. Every a_i is connected with the b_i at the same index. b_i tells us how many indexes of a we have to skip if choosing the corresponding a_i, so list index of b_i + b_i's value + 1 would be the position of the next a_i available.
The idea:
Create a new list c with same length as a (or b).
Begin at the end of c and save a_n at the same position in c. Iterate backwards through c and at each position add the max value of all previously saved values of c (with regards to the b_i-restriction) with the current a_i, else a_i + 0 if the b_i-resctriction goes beyond the list.
Return the max value of c.
How does that not work for me but for the others?? Funny enough, a few given samples work with my code. I'm questioning my coding ability...7 -
That moment when you neglect to study a DP problem you saw because you thought it was too hard.
But it shows up during your super important interview and you have no idea how to do it.
Hello, darkness my old friend.1 -
Teacher : So today we'll study Dynamic programming.
In DP we solve the problem LCS.
Student : Ok one more algorithm atleast I'll improve my algorithms.
Teacher : (after 10 minutes) so this is how we make the table and find the solution. Now let's move to another topic
-- End of Dynamic Programming --
@algorithms_in_india6 -
Can anyone help me understand how can I identify Dynamic Programming problem and general framework to solve the problem using DP?