1005ACM Penalty time

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.