英语翻译10

https://acs.jxnu.edu.cn/external/gym/doc/GYM100001A.doc

 

Charging

 1000ms  131072K

描述:

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 NN space ships.The NN ships are numbered from 11 to NN and lined up in order.

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

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

输入:

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

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

输出:

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

样例输入:

3 3
1 3
2 2
1 2

样例输出:

2

题目大意:

XXY是宇宙之王,为了抵抗入侵,他下令建造了许多太空战舰,现在他想给他的飞船充电。
他有NN太空船。NN船编号从11到NN,排列整齐。Xxy有MM充电计划。第一个计划是由两个正整数Li、RILI、Ri描述的。意思是在这个计划中,他将对从莉莉号到里利号的船只进行充电。
如果他完全选择了TOT计划,xx是在每个计划中收取费用的船只的数量。Xxy希望使最小(tot,x)min(tot,x)min(tot,x)的值最大化。
 

输入:

第一行包含两个正整数NN和M(N,M≤300000)M(N,M≤300000)。

输出:

输出包含一个正整数。最小(tot,x)min(tot,x)的最大值。

样例输入:

3 3
1 3
2 2
1 2

样例输出:

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值