英语翻译11

https://www.luogu.com.cn/problem/CF4D

题目描述

Peter decided to wish happy birthday to his friend from Australia and send him a card. To make his present more mysterious, he decided to make a chain. Chain here is such a sequence of envelopes AA = { a_{1},a_{2},...,a_{n}a1​,a2​,...,an​ }, where the width and the height of the ii -th envelope is strictly higher than the width and the height of the (i-1)(i−1) -th envelope respectively. Chain size is the number of envelopes in the chain.

Peter wants to make the chain of the maximum size from the envelopes he has, the chain should be such, that he'll be able to put a card into it. The card fits into the chain if its width and height is lower than the width and the height of the smallest envelope in the chain respectively. It's forbidden to turn the card and the envelopes.

Peter has very many envelopes and very little time, this hard task is entrusted to you.

输入格式

The first line contains integers nn , ww , hh ( 1<=n<=50001<=n<=5000 , 1<=w,h<=10^{6}1<=w,h<=106 ) — amount of envelopes Peter has, the card width and height respectively. Then there follow nn lines, each of them contains two integer numbers w_{i}wi​ and h_{i}hi​ — width and height of the ii -th envelope ( 1<=w_{i},h_{i}<=10^{6}1<=wi​,hi​<=106 ).

输出格式

In the first line print the maximum chain size. In the second line print the numbers of the envelopes (separated by space), forming the required chain, starting with the number of the smallest envelope. Remember, please, that the card should fit into the smallest envelope. If the chain of maximum size is not unique, print any of the answers.

If the card does not fit into any of the envelopes, print number 00 in the single line.

皮特为了让澳大利亚的好朋友有一个快乐的生日决定送他一个生日贺卡。为了让礼物更神秘,他决定做一条链子。链这里是这样一个信封序列A = A { A _ { 1 },a_{2},...,a_{n} a 一 ​ ,a 2 ​ ,...,a n ​ },其中第I个信封的宽度和高度分别严格高于第(I-1)个信封的宽度和高度。链大小是链中信封的数量。

彼得想用他所有的信封做成最大尺寸的链条,链条应该是这样的,这样他就能往里面放一张卡片。如果卡片的宽度和高度分别低于链中最小信封的宽度和高度,则卡片适合链。禁止翻动卡片和信封。

第一行包含n,w,h。分别代表皮特拥有的信封数目,贺卡的宽和高。接下来n行,每行包含两个整数,分别代表宽和高。

在第一行打印最大链条尺寸。在第二行打印信封的编号(用空格隔开),形成所需的链,从最小信封的编号开始。请记住,卡片应该放在最小的信封里。如果最大尺寸的链不是唯一的,打印任何答案。

如果卡片无法装入任何信封,请在单行中打印数字0

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值