题目重现
The ACM ICPC’s rule of scoring is as the following:
A problem is solved when it is accepted by the judges. Teams are ranked according to the most problems solved. For the purposes of awards, or in determining qualifier(s) for the World Finals, teams who solve the same number of problems are ranked by least total time. The total time is the sum of the time consumed for each problem solved. The time consumed for a solved problem is the time elapsed from the beginning of the contest to the submittal of the accepted run plus 20 penalty minutes for every rejected run for that problem regardless of submittal time. There is no time consumed for a problem that is not solved.
For example, if one has the following contest record:
- At the 100th minute submitted problem A, rejected;
- At the 140th minute submitted problem B, rejected;
- At the 150th minute submitted problem B, accepted;
- At the 160th minute submitted problem C, accepted.
Then his total time = (150+20) + 160 = 330. Notice that it took him only 10 minutes to finish problem C. Assume that he spent 40 minutes on reading all the problems through, then if he could do problem C first and problem A last, his contest record might look like:
- At the 50th minute submitted problem C, accepted;
- At the 90th minute submitted problem B, rejected;
- At the 100th minute submitted problem B, accepted;
- At the 160th minute submitted problem A, rejected.
Then his total time would be 50 + (100+20) = 170. Hence the order of solving the problems will affect one’s final rank.
Now suppose that you are in a one-person team. It will take you t0 minutes to read all the problems through. Judging by your experience, you may estimate the minutes ti that you will take to solve problem i . And more, the earlier you get one problem done, the more unlikely that you will make mistakes on programming. Assume that if a solution is first time submitted in the first hour (60 minutes inclusive), it will get accepted at once; if it is first time submitted in the second hour, it will be rejected once; if it is first time submitted in the third hour, it will be rejected twice; etc. You may also estimate the minutes