记录编号 205422 评测结果 AAAAAAAAAA
题目名称 [SYOI 2015] Asm.Def的一秒 最终得分 100
用户昵称 GravatarSatoshi 是否通过 通过
代码语言 C++ 运行时间 0.316 s
提交时间 2015-11-05 12:35:03 内存使用 4.06 MiB
显示代码纯文本
#include <fstream>
#include <algorithm>
#define N 100010
using namespace std;
typedef long long ll;
ifstream in("asm_second.in");
ofstream out("asm_second.out");
int n;
ll g[N]={0};
int f[N]={0};
int ans=0;
ll INF=1;
class point
{
public:
	ll x,y;
	void make(ll a,ll b)
	{
		x=a;
		y=b;
	}
	point operator +(point a)
	{
		point b;
		b.x=x+a.x;
		b.y=y+a.y;
		return b;
	}
	point operator -(point a)
	{
		point b;
		b.x=x-a.x;
		b.y=y-a.y;
		return b;
	}
	ll operator *(point a)
	{
		ll solo=0;
		solo=x*a.x+y*a.y;
		return solo;
	}
	ll operator ^(point a)
	{
		ll solo=0;
		solo=x*a.y-y*a.x;
		return solo;
	}
	point operator *(int a)
	{
		point b;
		b.x=a*x;
		b.y=a*y;
		return b;
	}
	void change(point a,point b)
	{
		ll xx,yy;
		xx=y*b.x-x*b.y;
		yy=x*a.y-y*a.x;
		x=-xx;
		y=-yy;
	}
}S,T,P[N],Q[N];
bool operator <(point a,point b)
{
	if(a.x==b.x)return a.y<b.y;
	return a.x<b.x;
}
void read()
{
	int i,k;
	ll Y;
	INF=INF<<58;
	in>>n;
	in>>S.y>>S.x>>T.y>>T.x;
	for(i=1;i<=n;i++)
	{
		in>>Q[i].x>>Q[i].y;
		Q[i].change(S,T);
	}
	Q[++n].make(0,0);
	sort(Q+1,Q+n+1);
	for(i=1;i<=n;i++)g[i]=INF;
	for(i=1;i<=n;i++)
	{
		if(Q[i].x<0||Q[i].y<0)continue;
		k=lower_bound(g+1,g+n+1,Q[i].y)-g;
		f[i]=k;
		g[k]=Q[i].y;
	}
	//for(i=1;i<=n;i++)out<<f[i]<<' ';
	ans=0;
	for(i=1;i<=n;i++)
	{
		ans=max(ans,f[i]);
	}
	out<<ans-1<<endl;
}
int main()
{
	read();
	//work();
	return 0;
}