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 |
学会了一个%*c#include <cstdio> int main() { int M,T,Up,Flat,Down; while(scanf("%d%d%d%d%d",&M,&T,&Up,&Flat,&Down)!=EOF) { int time=0,ans=0; char ch; ch=getchar(); for(int i=0;i!=T;++i) { scanf("%c%*c",&ch); if(ch=='u' || ch=='d')time+=(Up+Down); else if(ch=='f')time+=2*Flat; if(time<=M)++ans; } printf("%d\n",ans); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator