CSU 1507 Super Large LED display tenth session of Hunan Province game problem

Source: Internet
Author: User

Title Link: http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1507

Problem-solving ideas: This is a simulation problem, read so many people's code, I think my code is the simplest, haha, in fact, the score changes in the time to calculate the lamp light number of complex, I was directly violent

AC Code:

#include <iostream>#include<cstdio>#include<cstdlib>#include<cstring>using namespacestd;Const intm=45000;intc[Ten]={6,2,5,5,4,5,6,3,7,6};Chara[5],b[5];structnode{intx, Y, Z;} T[M];intMain () {intCa=1;  while(1)  {    inti=-1, g=0, h=0, X1,Y1,Z1; Long Longsum=0;  while(SCANF ("%s", a)! =EOF) {scanf ("%d:%d:%d",&x1,&y1,&Z1); I++; t[i].x=x1;t[i].y=y1;t[i].z=Z1; intAns= (t[i].x-t[i-1].x) *3600+ (t[i].y-t[i-1].Y) * -+t[i].z-t[i-1].z; if(strcmp (A,"START")==0)Continue; if(h> About) {sum+=ans* (c[h/ -]+c[h/Ten%Ten]+c[h%Ten]);} Else  if(h>9) {sum+=ans* (c[h/Ten]+c[h%Ten]);} ElseSum+=ans* (c[h%Ten]);      if(g> About) {sum+=ans* (c[g/ -]+c[g/Ten%Ten]+c[g%Ten]);} Else  if(g>9) {sum+=ans* (c[g/Ten]+c[g%Ten]);} Else{sum+=ans* (c[g%Ten]);}if(strcmp (A,"END")==0) Break; intx2; scanf ("%s%d",b,&x2); if(strcmp (b,"Home")) h+=x2; Else if(strcmp (b,"Guest")) g+=x2;      }      if(i==-1) Break; printf ("Case %d:%lld\n", ca++, sum); }  return 0;}

CSU 1507 Super Large LED display tenth session of Hunan Province game problem

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.