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

这样不行。。。AC 了。。但不是0ms

Posted by blank_bird at 2011-05-18 22:36:32 on Problem 3672
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#define N 100005
int main(void)
{
	char str[N];
	int m,u,f,d;
	int t;
	int i;
	int now=0;
	scanf("%d%d%d%d%d",&m,&t,&u,&f,&d);
	getchar();
	for(i=0;i<t;i++)
	{
		str[i]=getchar();
		getchar();
	}
	for(i=0;i<t;i++)
	{
		if(now>m)
			break;
		if(str[i]=='u'||str[i]=='d')
			now+=(u+d);
		else
			now+=f<<1;
	}
	printf("%d\n",i-1);

}

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