HBC52033NIT的签到题,gcd与exgcd,数论Energy stones题解

一点都不欢乐 算法基础篇 105 0
不断提升技能,才能在职场中立于不败之地!全网最全C++题库,助您成为编程领域的佼佼者。
CNZ need to eat energy generated by energy stones., the stone's energy stops increasing once it reach. Each time he absorbs the energy of a continuous interval of stone. For example, if CNZ absorbs the energy of [S, T] stones, all energy stones numbered from. Twill become zero units of energy. CNZ can get the sum of energy in this range.What's the total amount of energy CNZ has eaten after

CNZ lives in the forest, and he has N N energy stones, numbered from 1 1 to N N . CNZ need to eat energy generated by energy stones. The i-th i−th energy stone initially contains E_i E i ​ units of energy and will increase L_i L i ​ units of energy each second. The maximum energy of i-th i−th energy stone is C_i C i ​ , the stone's energy stops increasing once it reach C_i C i ​ . Each time he absorbs the energy of a continuous interval of stone. For example, if CNZ absorbs the energy of [S, T] stones, all energy stones numbered from S S to T T will become zero units of energy. CNZ can get the sum of energy in this range. CNZ will eat M M  times. The i-th eating happens after t_i t i ​ seconds, and eat interval is [S_i, T_i] [S i ​ ,T i ​ ]. What's the total amount of energy CNZ has eaten after M M eating.

HBC52033NIT的签到题,gcd与exgcd,数论Energy stones题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)
全网最全C++题库,助您挑战自我,突破极限,成为编程领域的佼佼者!

标签: HBC52033NIT的签到题 gcd与exgcd 数论Energy stones题解