#Help with CS problem 4

27 messages · Page 1 of 1 (latest)

glacial cove
#

A serial killer is stabbing a person with a knife. The victim loses 10 litres of blood everytime stabbed. The victim's initial blood volume is b litres. The serial killer can stab the victim at a maximum of 100 times before he gets tired, and will also stop when the victim's blood is completely drained. Let s[t] denotes the satisfaction level experienced by the serial killer during the t-th second (if he stabs). At each t, the serial killer can choose to stab or to wait and do nothing. What is the maximum satisfaction level the serial killer can experience before his victim's death?

Constraint:
1<=b<=1000
1<=s[t]<=100, 1<=t<=100

coral lightBOT
#
  1. Wait patiently for a helper to come along.
  2. Once someone helps you, say thank you and close the thread with:
+close
  1. Feel free to nominate the person for helper of the week in #helper-nominations
  2. Do not ping the mods, unless someone is breaking the rules.
  3. If you're happy with the help you got here, and the server overall, you can contribute financially as well:
shy steeple
#

well st isnt even defined
does waiting lose s(t)? does stabbing gain s(t)? by how much?

glacial cove
#

they are inputted

glacial cove
#

lemme ask my friend

#

no waiting doesn't lose s(t)

shy steeple
#

but why would you ever wait then

#

if non wait is always increase

glacial cove
#

which is the victim's blood

#

the 4th sentence

shy steeple
#

still doesn’t make sense

glacial cove
shy steeple
#

if stopping doesnt have any effect

#

and theres no defined effect for stabbing

#

but stopping is 0

#

so theres no point

#

idk if waiting has a point

#

then ofc you just keep stabbing until theres no blood

#

does the blood replenish or smthn

glacial cove
shy steeple
#

then this problem makes 0 sense !!!

lucid solstice
# shy steeple then this problem makes 0 sense !!!

I think I understood what OP means
so for example:
b=100
s=[2,3,4,5,6,7,8,9,1,1,10,...]
b/10 = 100/10 = 10
so 10 stabs are needed
here if he keeps stabbing without delay then satisfaction level is:
2+3+4+...+9+1+1 = 46
but if after the 9th step he didn't do anything and skips t=10 (where s[t]=1) and after that continues to stab at t=11 then satisfaction level is:
2+3+4+5+6+7+8+9+1+10 = 55

shy steeple
#

why does it go 1 1 10

lucid solstice