Week 3
The website I used was down so I went to a different website and noticed they had much variety when it came to difficulty so I chose a slightly harder difficulty of 938. I liked this website a lot because It gave me my own coding window that I can use to submit and test with, unlike the other site where I would post my code from eclipse.
At first it can seem a bit more complicated the problems before but in reality they are very similar. We can first see that the first line, like all the other problems, has the number of test cases. After taking the test cases we can scan the 3 integers and compare them like the instruction say. After we assess D, L, R we can minus one from T so that when we reach the last line it will be done. The hardest part of this was getting the stuff you need of the instructions. Personally, I was a bit tripped up with the constraints I thought that I would be using that in my assessment but they just telling me the range of how big/small the numbers could be.
I put the problems out of order but the next code I did was very similar in input but instead of comparing three integers I was doing a calculation. You read in the instructions that I take P, people, M, kilometers per liter, and V , liters of fuel. Reading the problem it says that the more people the less kilometers per liter so I understood that we subtract them. It also includes that P includes the driver so we have to exclude him the subtraction because its all people in addition to the driver. Then we simply multiply the remaining kilometers per liter by the number of liters to get the max kilometers.
Code and instructions down below
Nice progress again this week, Ronin.
ReplyDelete