Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
This is my code. Why does it TLEed?#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator