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

为什么还是错?

Posted by chhaya at 2009-06-26 10:34:16 on Problem 1083
#include <stdio.h>

int main(void)
{	
	int T, n, i, m, j, count, k;
	int s[200], t[200], cr[200];
	FILE *fp;
	fp = fopen("1083.txt","r");
	fscanf(fp,"%d", &T);
	for(m=1; m<=T; m++)
	{
		fscanf(fp,"%d", &n);
		for(i=1; i<=200; i++)
			cr[i] = 0;
		for(j=1; j<=n; j++)
		{
			fscanf(fp,"%d%d", &s[j], &t[j]); //输入N次
			if(s[j] % 2)
				s[j]++;
			if(t[j] % 2)
				t[j]++;
			s[j] /=2;
			t[j] /=2;
			if(s[j]>t[j])
			{
				int temp;
				temp = s[j];
				s[j] = t[j];
				t[j] = temp;
			}
			for(k=s[j]; k<=t[j];k++)
			{
				cr[k]++;
			}
		}
		count = cr[1];
		for(i=1; i<=200; i++)
		{
			if(cr[i]>count)
			{
				count = cr[i];
			}
		}
		printf("%d\n", count*10);
	}
}

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