I am getting WA on the problem TRAITHLON of inoi 2012. I don’t know whether the problem is with the logic or the code. This is my logic.
1.Store the sum of pole vault time and doughnut eating tim in an array sumtime.
2.Find out the position (each position represents a person) for which sumtime is maximum provided it has not been selected earlier (i.e it has not been burnt).
3.In case of tie, consider the one with minimum cobol time (because then the delay time will be less)
4.Add the sumtime and the delay time (additional time in the code) and the cobol time and store it in the variable minrequiredtime and finally print it in the end.
My code is here: