HBC223857[NOI1999]钉子和小球,线性dp,动态规划DescentofDragons题解

季陌殇 算法基础篇 46 0
不断提升技能,才能在职场中立于不败之地!全网最全C++题库,助您成为编程领域的佼佼者。
There are n{n}n dragons in a row, indexed 1 through n{n}n. Every dragon has a level, and initially, every dragon is of level 0. You are a hero of the league of explorers. And your task is to counter the attack of the league of evil. You are training the dragons in peacetime. When the villains launched a battle, you have to select the best dragon to defend. Specifically, you have to process q{q}q events in order. Each event has one of the following types. Training Given l,r,x{l, r, x}l,r,x, for all dragons of level x{x}x with indices between l{l}l to r{r}r inclusive, increase their levels to x+1{x+1}x+1; Defense Given l,r{l, r}l,r, find the maximum level of dragons with indices between l{l}l to r{r}r inclusive.

Hey, look, what's that? It's dragons in dragons' descent! There are n{n}n dragons in a row, indexed 1 through n{n}n. Every dragon has a level, and initially, every dragon is of level 0. You are a hero of the league of explorers. And your task is to counter the attack of the league of evil. You are training the dragons in peacetime. When the villains launched a battle, you have to select the best dragon to defend. Specifically, you have to process q{q}q events in order. Each event has one of the following types. Training Given l,r,x{l, r, x}l,r,x, for all dragons of level x{x}x with indices between l{l}l to r{r}r inclusive, increase their levels to x+1{x+1}x+1; Defense Given l,r{l, r}l,r, find the maximum level of dragons with indices between l{l}l to r{r}r inclusive.

HBC223857[NOI1999]钉子和小球,线性dp,动态规划DescentofDragons题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)
成为编程大师,不再是梦想!全网最全C++题库,助您开启编程新篇章。

标签: HBC223857[NOI1999]钉子和小球 线性dp 动态规划DescentofDragons题解