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

为什么用cin就TLE?

Posted by Jimbear at 2012-01-31 21:17:30 on Problem 2777
int main()
{
	int length,numOfColor,option;
	int i,j,begin,end,color;
	char flag[2];
	//cin>>length>>numOfColor>>option;
	 scanf("%d %d %d", &length, &numOfColor, &option);
	init(1,1,length);
	for(i = 0 ; i < option ; i++)
	{
		//cin>>flag;
		scanf("%s",flag);
		if(flag[0] == 'C')
		{
			//cin>>begin>>end>>color;
			scanf("%d %d %d", &begin, &end, &color);
			freshColor(1,begin,end,color);
		}
		else
		{
			//cin>>begin>>end;
			 scanf("%d %d", &begin, &end);
			for(j = 0 ; j < 40 ; j++) c[j] = 0;
			cnt = 0;
			checkColor(1,begin,end);
			printf("%d\n",cnt);
		}
	}
	return 0;
}


//--------------------------------------------------------------
注释掉的如果用上就会TLE,不是应该一样吗?求教。。。

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