记录编号 206522 评测结果 AAAAAAAAAA
题目名称 [SYOI 2015] Asm.Def的一秒 最终得分 100
用户昵称 Gravatarlyxin65 是否通过 通过
代码语言 C++ 运行时间 0.194 s
提交时间 2015-11-07 20:41:19 内存使用 2.08 MiB
显示代码纯文本
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>

#define cls(x, y) memset(x, y, sizeof(x))
#define fly(...) fprintf(stderr, __VA_ARGS__)

using namespace std;

typedef long long LL;

template<typename T> inline bool tense(T &x, T y) { return x < y ? x = y, 1 : 0; }

template<typename T>
inline void read(T &x)
{
	int c; bool f = 0;
	while(c = getchar(), c < '0' || c > '9') if(c == '-') f = 1;
	for(x = 0; c >= '0' && c <= '9'; c = getchar()) x = x * 10 + c - '0';
	f ? x = -x : 0;
}

//the end of tempalte

const int maxn = 100005;
const int inf = 0x3f3f3f3f;

struct Point
{
	LL x, y;
	bool operator < (const Point &rhs) const {
		return x < rhs.x || (x == rhs.x && y > rhs.y);
	}
}p[maxn];

int n, a, b, c, d;

void input()
{
	register LL x, y;
	read(n); read(a); read(b); read(c); read(d);
	for(int i = 1; i <= n; ++i)
	{
		read(x), read(y);
		p[i] = (Point){c * x - d * y, b * y - a * x};
		if(p[i].x <= 0 || p[i].y <= 0) i--, n--;
	}
	p[++n] = (Point){0LL, 0LL};
}

void solve()
{
	register int ans = 0;
	static LL g[maxn]; cls(g, inf);
	
	sort(p + 1, p + n + 1);
	for(int i = 1; i <= n; ++i)
	{
		LL *TAT = std::lower_bound(g + 1, g + n + 1, p[i].y);
		*TAT = p[i].y; tense(ans, int(TAT - g));
	}
	printf("%d\n", ans - 1);
}

int main()
{
	freopen("asm_second.in", "r", stdin);
	freopen("asm_second.out", "w", stdout);
	
	input();
	solve();
	
	fclose(stdin);
	fclose(stdout);
	return 0;
}