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

写简单一些,用总的有效点数(如果横纵座标等于中心点算无效点)减去 Stan的,得到Olli的,可以减少出错

Posted by sunmoonstar_love at 2005-07-07 18:43:20 on Problem 2460
In Reply To:总是WA.. Posted by:perturbation at 2005-07-07 17:02:38
> #include <fstream>
> using namespace std;
> void main(){
> 	int Stan=0,Ollie=0;
> 	int x[200000],y[200000],cx,cy;
> 	int len;
> 	ifstream finput("input.txt");
> 	finput>>len;
> 	for(int i=1;i<=len;i++){
> 		finput>>x[i]>>y[i];
> 	}
> 	finput.close();
> 	cx=x[(len+1)/2];
> 	cy=y[(len+1)/2];
> 	for(i=1;i<=len;i++){
> 		if((x[i]>cx&&y[i]>cy)||(x[i]<cx&&y[i]<cy))
> 			Stan++;
> 		else if((x[i]>cx&&y[i]<cy)||(x[i]<cx&&y[i]>cy))
> 			Ollie++;
> 	}
> 	ofstream foutput("output.txt");
> 	foutput<<Stan<<' '<<Ollie;
> 	foutput.close();
> }
> 
> 哪里出问题了啊?

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