Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

This is my code. Why does it TLEed?

Posted by Failed_Exile at 2005-12-03 11:56:44 on Problem 1326
#include <stdio.h>

int main()
{
  char c[100];
  long int m,s;
  while(getchar()!='#')
  {
    s=0;
    while(getchar()!='0')
    {
      scanf("%s%s%ld",c,c,&m),getchar();
      switch(getchar())
      {
        case 'F': s+=m+m; break;
        case 'B': s+=m+(m+1)/2; break;
        case 'Y': s+=(m>500)?m:500; break;
      }
      getchar();
    }
    getchar(),printf("%ld\n",s);
  }
  return 0;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator