题目大意

略...

(吐槽这题面...让我毫无阅读兴趣)

题解

首先要求出在以两条斜线为新坐标轴下,每个点的坐标

那么....按x先排序

再求y的最长上升子序列

复杂度O(nlogn)吧

记得开longlong

#include<cstdio>
#include<algorithm>
#include<cstring>
#define ll long long
using namespace std;
inline ll read()
{
ll sum = ,p = ;
char ch = getchar();
while(ch < '' || ch > '')
{
if(ch == '-')
p = -;
ch = getchar();
}
while(ch >= '' && ch <= '')
{
(sum *= ) += ch - '';
ch = getchar();
}
return sum * p;
}
const int maxn = ;
ll n,a,b,c,d,f[maxn];
struct pot
{
ll x,y;
}p[maxn];
bool cmp(pot a,pot b){return a.x < b.x;}
ll lis()
{
ll len = ;
for(int i = ;i <= n;i++)
if(p[i].x > && p[i].y > )
{
if(p[i].y > f[len])
f[++len] = p[i].y;
else
if(p[i].y< f[])
f[] = p[i].y;
else
f[lower_bound(f + ,f + len + ,p[i].y) - f] = p[i].y;
}
return len;
}
int main()
{
n = read();
a = read(),b = read(),c = read(),d = read();
for(int i = ;i <= n;i++)
{
int x = read(),y = read();
p[i].x = c * x - d * y;
p[i].y = b * y - a * x;
}
sort(p+,p + n + ,cmp);
printf("%lld",lis());
return ;
}

8.5-Day1T3--Asm.Def 的一秒的更多相关文章

  1. COGS2085 Asm.Def的一秒

    时间限制:1 s   内存限制:256 MB [题目描述] “你们搞的这个导弹啊,excited!” Asm.Def通过数据链发送了算出的疑似目标位置,几分钟后,成群结队的巡航导弹从“无蛤”号头顶掠过 ...

  2. Asm.Def点大兵

    syzoj上的题,收货很多,orz天天学长 原题: Asm.Def奉命组建一支m人的特种作战小队前往圣迭戈.他有n名候选人,可以在其中任意挑选.由于小队中每个人都有独特的作用,所以次序不同的两种选法被 ...

  3. cogs——2098. Asm.Def的病毒

    2098. Asm.Def的病毒 ★☆   输入文件:asm_virus.in   输出文件:asm_virus.out   简单对比时间限制:1 s   内存限制:256 MB [题目描述] “这就 ...

  4. COGS2090 Asm.Def找燃料

    时间限制:1 s   内存限制:256 MB [题目描述] “听说咱们要完了?”比利·海灵顿拨弄着操纵杆,头也不回地问Asm.Def. “不要听得风就是雨.” “开个玩笑嘛.不就是打机器人,紧张啥,你 ...

  5. COGS 2091. Asm.Def的打击序列

    ★★★   输入文件:asm_lis.in   输出文件:asm_lis.out   简单对比时间限制:4 s   内存限制:256 MB [题目描述] 白色圆柱形的“蓝翔”号在虚空中逐渐变大,一声沉 ...

  6. 2084. Asm.Def的基本算法

    2084. Asm.Def的基本算法 传送门 ★☆   输入文件:asm_algo.in   输出文件:asm_algo.out   简单对比时间限制:1 s   内存限制:256 MB [题目描述] ...

  7. COGS 2084. Asm.Def的基本算法

    ★☆   输入文件:asm_algo.in   输出文件:asm_algo.out   简单对比时间限制:1 s   内存限制:256 MB [题目描述] “有句美国俗语说,如果走起来像鸭子,叫起来像 ...

  8. COGS 2082. Asm.Def谈笑风生

    ★   输入文件:asm_talk.in   输出文件:asm_talk.out   简单对比时间限制:2 s   内存限制:256 MB [题目描述] “人呐都不知道,自己不可以预料,直升机刚一出圣 ...

  9. COGS 2098. Asm.Def的病毒

    ★☆   输入文件:asm_virus.in   输出文件:asm_virus.out   简单对比时间限制:1 s   内存限制:256 MB [题目描述] “这就是我们最新研制的,世界上第一种可持 ...

  10. cogs——2084. Asm.Def的基本算法

    2084. Asm.Def的基本算法 ★☆   输入文件:asm_algo.in   输出文件:asm_algo.out   简单对比时间限制:1 s   内存限制:256 MB [题目描述] “有句 ...

随机推荐

  1. vue中什么是模块 什么是组件?

    模块: 封装好的应用程序,它只是js文件的封装. 组件: 一个完整的单位个体,可以有js可以有css和html. 作者:晋飞翔手机号(微信同步):17812718961希望本篇文章 能给正在学习 前端 ...

  2. lib目录和maven dependency目录的jar包冲突

    用eclipse时新建项目时,会在lib目录下自动生成一些jar包,然后又在pom.xml文件中添加了依赖,导致lib下的jar包和maven dependency目录下的jar包产生了冲突.刚开始r ...

  3. [NOI2014] 魔法森林 - Link Cut Tree

    [NOI2014] 魔法森林 Description 给定一张图,每条边 \(i\) 的权为 \((a_i,b_i)\), 求一条 \(1 \sim n\) 路径,最小化 \(\max_{i\in P ...

  4. 使用Powershell开机启动隐藏窗口的程序

    1.打开注册表找到键值:计算机\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run 2.添加字符串值:StartJetSer ...

  5. tp5.1 Auth类实现权限管理

    了解来这么久权限控制权限的知识,却不知道如何写代码,网上的代码多数并没有多少完整的源码能提供参考.偶然看到官网的例子,现在终于也把源码的实现也弄得明白了一点. tp5框架的Auth类可以实现页面的访问 ...

  6. C语言 strlen

    C语言 strlen #include <string.h> size_t strlen(const char *s); 功能:计算指定指定字符串s的长度,不包含字符串结束符‘\0’ 参数 ...

  7. AC3 encoder flow

    AC3 encoder flow 如下: 1.input PCM PCM在进入encoder前会使用high pass filter来移除信号的DC部分来达到更有效的编码. 2.Transient d ...

  8. 【vue store的使用方法】(this.$store.state this.$store.getters this.$store.dispatch this.$store.commit)

    vue 页面文件 <template> <div> {{this.$store.state.count}}<br/> {{count}}<br/> {{ ...

  9. springboot引入Oracle依赖

    最近学习spring boot,在网上找一些项目学习,有的项目引入了oracle驱动包,自己搭建一直不成功,百度发现说是权限问题无法下载. 然后参考下面博客终于解决:springboot引入Oracl ...

  10. 2018-2019-20175334实验三《敏捷开发与XP实践》实验报告

    2018-2019-20175334实验三<敏捷开发与XP实践>实验报告 一.实验内容及步骤 实验三 敏捷开发与XP实践-1 实验三 敏捷开发与XP实践 http://www.cnblog ...