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

Why WA?

Posted by chj8081 at 2008-02-19 18:19:29 on Problem 1083
   #include <iostream>
#include <FSTREAM>
using namespace std;
struct movingTable{
	int even;
	int odd;
	int crdr;
};
int max=0;
movingTable a[201];
void format(void){
	int i,k=1;
	for(i=2;i<=400;i+=2){
		a[k].even=i;
		a[k].odd=i-1;
		a[k].crdr=0;
		k++;
	}
	max=0;
}
void main(){
	int test;
	int n,s,t,i;
	//ifstream in("input.txt");
	cin>>test;
	while(test--){
		cin>>n;
		format();
		while(n--){
			cin>>s>>t;
			if(t<s){
				int tmp;
				tmp=s;
				s=t;
				t=tmp;
			}
			if(s%2==0 && t%2==1)
				t++;
			for(i=s;i<=t;i+=2){
				a[i/2].crdr++;
			
			}

		}
		for(i=1;i<=200;i++)
			if(max<a[i].crdr)
				max=a[i].crdr;
		cout<<max*10<<endl;
	}

	
	
}

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