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 2010201307 at 2012-02-18 16:25:15 on Problem 1083
#include <iostream>
#include <stdio.h>
#include <cstring>
#include <map>
#include <vector>
#include <cmath>
#include <set>
#include <algorithm>
using namespace std;
int main()
{
	int n,t,i,a,b,k,s,j,c;
	while(scanf("%d",&t)!=EOF)
	{
		while(t--)
		{
			s=0;
			int room[250]={0};
			scanf("%d",&n);
			for(i=0;i<n;i++)
			{
				scanf("%d%d",&a,&b);
				if(a>b)
				{
					c=b;
					b=a;
					a=c;	
				}	
			
				for(j=((a+1)/2);j<=((b+1)/2);j++)
				{
					room[j]++;
					if(room[j]>s)
					{
						s=room[j];	
					}	
				} 
			}
			printf("%d\n",s*10);
				
		}	
	}
	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