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

为什么WA.....

Posted by John_THU at 2014-03-10 21:14:36 on Problem 1083
#include <stdio.h>
#include <memory.h>

int corridor[201];
int src[201];
int dst[201];


int main(int argc, char *argv[]) 
{
	int t;
	scanf("%d",&t);
	while(t--)
	{
		memset(corridor,0,sizeof(corridor));
		memset(src,0,sizeof(src));
		memset(dst,0,sizeof(dst));
		int n;
		scanf("%d",&n);
		for(int i=0;i<n;i++)
			scanf("%d%d",src+i,dst+i);
		for(int i=0;i<n;i++)
			for(int j=(src[i]-1)/2;j<=(dst[i]-1)/2;j++)
				corridor[j]+=10;
		int max=0;
		for(int i=0;i<200;i++)
			if(corridor[i]>max)
				max=corridor[i];
		if(max!=0)
			printf("%d\n",max);
		else
			printf("10\n");
	}
	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