As you have to minimize the score and maximize the penalty, you have to try to keep the score same as the position you are replacing and decrease 11 from the penalty. Now, there might occur a case where the penalty is 00 and it's not possible to decrease the penalty, then increase the score by 11 which is the minimum possible and make the penalty 180180 which is the maximum penalty in this case. There is another case, where  the scores and penalties are consecutive. For example, consider the two cases, (400 6, 400 5){(400  6,  400  5)} and (401 180,400 0){(401  180, 400  0)}. Here in both cases, the answer is 1-1. There is another instance where  the score might need to be greater than 25002500, in that case, answer is 1-1.

Contributors

Statistics

62% Solution Ratio
adnan_tokyEarliest, Jul '21
Nafis2003174.132453Fastest, 0.0s
Nafis2003174.132453Lightest, 5.5 kB
white_monsterShortest, 331B
Toph uses cookies. By continuing you agree to our Cookie Policy.