Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
写简单一些,用总的有效点数(如果横纵座标等于中心点算无效点)减去 Stan的,得到Olli的,可以减少出错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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator