英语题目作业(3)

原题:

Charging

描述:

Xxy is the king of the universe. In order to resist the invasion, he ordered the construction of many space warships.Now,he wants to charge his space ships.

He has N space ships.The N ships are numbered from 1 to N and lined up in order.

Xxy has M charging plans.The i-th plan is describe by two positive integers li,ri.It means in this plan, he will charge the ships numbered from li to ri.

Xxy will choose some of these plan.If he totally choose tot plans,x is the number of ships that charged in every plans.Xxy want to maximize the value of min(tot,x).

输入:

The first line contains two positive integers N and M(N,M≤300000).

The next M lines,each containing two positive integers li and ri.(li≤ri)

输出:

The output contains a positive integer. The maximal value of min(tot,x).

(链接:Charging | JXNUOJ

翻译:

充电

Xxy是宇宙之王,为了抵抗入侵,他下令建造很多太空战舰。现在他想要给他的太空战舰充电。

他有N艘太空战舰,现给它按1到N编号并有序排好。

Xxy有M个充电计划。第i个计划描述了两个正整数li,ri。这意味着在这次计划中,他将为编号为li到ri的战舰充电。

Xxy将选择这些计划中选一些。如果他最终选择了tot个计划,x表示每个计划中所冲的军舰数。Xxy想要使min(tot,x)的价值最大化。

输入:

第一行包括两个正整数N和M(N,M<=300000)。接下来的M行,每行包括两个正整数li和ri(li<=ri)。

输出:

输出一个正整数,使min(tot,x)价值最大化。

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值