HDU 5306. Gorgeous Sequence

Breif description:

There is a sequence a of length n. We use ai to denote the i-th element in this sequence. You should do the following three types of operations to this sequence.

  • 0 x y t: For every x≤i≤y, we use min(ai,t) to replace the original ai's value.(区间取 min)
  • 1 x y: Print the maximum value of ai that x≤i≤y.(区间求最大値)
  • 2 x y: Print the sum of ai that x≤i≤y.(区间求和)

ゆっくり読んでください ...

HDU 3820. Golden Eggs

Brief description:

给出一块 n*m 的区域,已知区域中的每个格子都可以放金蛋或者是银蛋。
每个格子放金蛋或银蛋时,可以获得不同的收益,但如果相邻的两个格子放相同的蛋的话,会产生一些代价。(都放金蛋的话产生 g 代价、都放银蛋的话产生 s 代价)。

ゆっくり読んでください ...