The ACM International College Program Design Competition, hosted by the International Computer Society, is an annual competition that showcases the ability of college students to innovate, team, and develop procedures, analysis and problem-solving skills under pressure. The team consists of up to three participants, the general Proposition 10-13 in the contest, the test paper description in English, the tournament time is 5 hours, the first 4 hours can see real-time rankings, the last hour of the list, can not see the rankings. Contests can use C, C + +, and Java. Focus on the player's algorithm and program design capabilities, players can carry any non-electronic materials, including books and printed procedures. Returns the result accepted the answer is correct, wrong anwser for the answer error, Presentation error indicates that the program did not output the answer in the prescribed format, Compile error, which indicates a program compilation errors.
In addition, ACM competition has a "penalty time" (penalty) concept, the first to do more than the ranks of the team, to make the same number of questions, from the penalty to judge. For example, C (problem number) in the 30th minute, done wrong 2 times, the third time to get the "Accepted", then the penalty is 30+20*2=70,20 is the conventional coefficient of ACM competition, the wrong one penalty 20 minutes, but if the title to the end of the game did not "Accepted", Then the problem is not punishable. The team with the same number of questions, the ranking of less penalty is more forward.
Only one line, tournament start time, topic submission accepted time, and number of commit errors (>=0)
When a problem is successfully passed
9:00 9:30 2
70
#include "stdio.h"
#include "math.h"
#include "string.h"
int main ()
{
int h1,m1,h2,m2,n,sum=0,i;
while (scanf ("%d:%d%d:%d%d", &h1,&m1,&h2,&m2,&n)!=eof)
{
if (H1==H2) {
Sum=m2-m1+20*n;
printf ("%d\n", sum);
}
else if (H2>H1)
{
Sum= (H2-H1) *60+ (M2-M1) +20*n;
printf ("%d\n", sum);
}
}
return 0;
}
1005ACM Penalty time