原题链接
Problem Statement
There are \(N\) products labeled \(1\) to \(N\) flowing on a conveyor belt. A Keyence printer is attached to the conveyor belt, and product \(i\) enters the range of the printer \(T_i\) microseconds from now and leaves it \(D_i\) microseconds later.
The Keyence printer can instantly print on one product within the range of the printer (in particular, it is possible to print at the moment the product enters or leaves the range of the printer). However, after printing once, it requires a charge time of \(1\) microseconds before it can print again. What is the maximum number of products the printer can print on when the product and timing for the printer to print are chosen optimally?
Constraints
- \(1\leq N \leq 2\times 10^5\)
- \(1\leq T_i,D_i \leq 10^{18}\)
- All input values are integers.
问题陈述
在一条传送带上有 \(N\) 个标有 \(1\) 至 \(N\) 的产品在流动。传送带上有一台 Keyence 打印机,产品 \(i\) 在 \(T_i\) 微秒后进入打印机的打印范围,并在 \(D_i\) 微秒后离开打印机。
KEYENCE 打印机可以立即打印打印机范围内的一个产品(尤其是在产品进入或离开打印机范围的瞬间)。但打印一次后,需要充电 \(1\) 微秒才能再次打印。如果产品和打印机打印时间选择最优,打印机最多可以打印多少产品?
标签:AtCoder,打印机,printer,打印,product,leq,print,abc325D From: https://www.cnblogs.com/9102qyy/p/18216464