题目大意

略...

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

题解

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

那么....按x先排序

再求y的最长上升子序列

复杂度O(nlogn)吧

记得开longlong

  1. #include<cstdio>
  2. #include<algorithm>
  3. #include<cstring>
  4. #define ll long long
  5. using namespace std;
  6. inline ll read()
  7. {
  8. ll sum = ,p = ;
  9. char ch = getchar();
  10. while(ch < '' || ch > '')
  11. {
  12. if(ch == '-')
  13. p = -;
  14. ch = getchar();
  15. }
  16. while(ch >= '' && ch <= '')
  17. {
  18. (sum *= ) += ch - '';
  19. ch = getchar();
  20. }
  21. return sum * p;
  22. }
  23. const int maxn = ;
  24. ll n,a,b,c,d,f[maxn];
  25. struct pot
  26. {
  27. ll x,y;
  28. }p[maxn];
  29. bool cmp(pot a,pot b){return a.x < b.x;}
  30. ll lis()
  31. {
  32. ll len = ;
  33. for(int i = ;i <= n;i++)
  34. if(p[i].x > && p[i].y > )
  35. {
  36. if(p[i].y > f[len])
  37. f[++len] = p[i].y;
  38. else
  39. if(p[i].y< f[])
  40. f[] = p[i].y;
  41. else
  42. f[lower_bound(f + ,f + len + ,p[i].y) - f] = p[i].y;
  43. }
  44. return len;
  45. }
  46. int main()
  47. {
  48. n = read();
  49. a = read(),b = read(),c = read(),d = read();
  50. for(int i = ;i <= n;i++)
  51. {
  52. int x = read(),y = read();
  53. p[i].x = c * x - d * y;
  54. p[i].y = b * y - a * x;
  55. }
  56. sort(p+,p + n + ,cmp);
  57. printf("%lld",lis());
  58. return ;
  59. }

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. Java学习笔记(十二)面向对象---内部类

    内部类的访问规则 内部类可以直接访问外部类中的成员,包括私有成员. 因为内部类中持有了一个外部类的引用,格式为:外部类名.this 外部类要访问内部类,必须要建立内部对象. class Outer { ...

  2. jdk8-》lambda

    lambda表达式 使⽤场景(前提):⼀个接⼝中只包含⼀个⽅法,则可以使⽤Lambda表达式,这样的接⼝称之为“函数接⼝” 语法: (params) -> expression   第⼀部分为括 ...

  3. Consider using the `--user` option or check the permissions.

    安装pip install C:\Users\道路\Documents\EGDownloads\pip-1.0.tar.gz 报错:Consider using the `--user` option ...

  4. 《NVM-Express-1_4-2019.06.10-Ratified》学习笔记(8.20)-- ANA

    8.20 非对称namespace访问报告 8.20.1 非对称namespace访问报告概况 非对称Namespace访问(ANA)在如下场景下产生,基于访问这个namespace的controll ...

  5. centos下配置mongodb定期备份

    https://brickyang.github.io/2017/03/02/Linux-%E8%87%AA%E5%8A%A8%E5%A4%87%E4%BB%BD-MongoDB/ 1.创建备份脚本 ...

  6. xrdp---远程桌面连接

    xrdp is an Open Source Remote desktop Protocol server, which allows you to RDP to your Linux server ...

  7. C分支语句的工程用法

    if语言中零值比较的注意点: -bool型变量应该直接出现于条件中,不要进行比较 -变量和零值比较时,零值应该出现在比较符号左边 -float型变量不能直接进行零值比较,需要定义精度 bool b = ...

  8. [CF]Round511

    这场比赛我及时的参加了,但是打的时候状态实在是太烂了,只做出来了Div2的AB题. A Little C loves 3 I 直接构造就行. B Cover Points 应该很容易就看出来这个等腰三 ...

  9. Android基础知识 -- Fragment

    Fragment是android3.0后提供的API(所以android:minSdkVersion="11"以上版本),主要针对平板UI.有自己的生命周期,但是必须依附在Acti ...

  10. python面试的100题(5)

    5.现有字典 d= {'a':24,'g':52,'i':12,'k':33}请按value值进行排序? sorted(d.items(),key=lambda x:x[1]) sorted函数 对由 ...