/***************************************************************\ *Author:Hu Wenbiao *Created Time: Tue 27 Jul 2010 07:10:34 PM CST *File Name: main.cpp *Description:几何题目。简单的叉积应用\***************************************************************///*========================*Head File*========================*\\#include#include #include #include /*----------------------*Global Variable*----------------------*/struct Cardboard{//隔板 int u,l;}card[5010];int toynum[5010],n,m,x1,y1,x2,y2,X,Y;//toynum计算数目//*=======================*Main Program*=======================*//using namespace std;bool left(int m){//判断toy在第m个隔板左边 int a=card[m].u-card[m].l,b=y1-y2,c=X-card[m].l,d=Y-y2; return a*d-b*c>0;}void location(){//二分法,将toy所在的区间数目加1 int s=0,t=n; int m=(s+t)/2; while(s