← Back to topics
Topic

parking[user tasks]

n
nemanja1990
i would like an explanation of the given inputs and outputs
A
Al3kSaNdaR
In first line you have 3 integers that represent the price of staying for 1, 2 and 3 trucks at the time. And you have 3 time intervals [T1,T2) when the trucks were at the parking, and you should output the cost of their staying.
n
nemanja1990
i know that, but when i calculate how much they would pay, i get wrong result

could you tell me for every truck and every minut how much is it paying
A
Al3kSaNdaR
Ok, give me a minute to type it.
A
Al3kSaNdaR
Here is the array that represent number of cars that were at the parking at i-th minute. [ For the first case! ]


1 2 3 3 2 1 1 0

So we have 1 * 5 + 2 * 3 + 3 * 1 + 3 * 1 + 2 * 3 + 1 * 5 + 1 * 5 = 5 + 6 + 3 + 3 + 6 + 5 + 5 = 33
n
nemanja1990
thanks, i had same calculations, but wrong result because i was tired. I hope I did well on the competition today because i'm really tired. 2 easy tasks and i have problems with both of them :-)
A
Al3kSaNdaR
No problem. =)
I've done 2 tasks on the competition and I'll try to do remaining tasks for the weekend. Good Luck ;)
n
nemanja1990
tnx, but i've allready solved them, now i can just wait

good luck to you