五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

LeetCode 2739. Total Distance Traveled

2023-06-18 12:22 作者:您是打尖兒還是住店呢  | 我要投稿


A truck has two fuel tanks. You are given two integers,?mainTank?representing the fuel present in the main tank in liters and?additionalTank?representing the fuel present in the additional tank in liters.

The truck has a mileage of?10?km per liter. Whenever?5?liters of fuel get?used up in the main tank,?if the additional tank has at least?1?liters of fuel,?1?liters of fuel will be transferred from the additional tank to the main tank.

Return?the maximum distance which can be traveled.

Note:?Injection from the additional tank is not continuous. It happens suddenly and immediately for every 5 liters consumed.

?

Example 1:

Input: mainTank = 5, additionalTank = 10Output: 60Explanation: After spending 5 litre of fuel, fuel remaining is (5 - 5 + 1) = 1 litre and distance traveled is 50km. After spending another 1 litre of fuel, no fuel gets injected in the main tank and the main tank becomes empty. Total distance traveled is 60km.

Example 2:

Input: mainTank = 1, additionalTank = 2Output: 10Explanation: After spending 1 litre of fuel, the main tank becomes empty. Total distance traveled is 10km.

計(jì)算距離的,簡單題目:

Runtime:?7 ms, faster than?100.00%?of?Java?online submissions for?Total Distance Traveled.

Memory Usage:?42.7 MB, less than?100.00%?of?Java?online submissions for?Total Distance Traveled.



LeetCode 2739. Total Distance Traveled的評論 (共 條)

分享到微博請遵守國家法律
德昌县| 营山县| 民乐县| 灵武市| 大兴区| 始兴县| 阿合奇县| 红桥区| 滦南县| 葵青区| 永吉县| 宁晋县| 称多县| 嵩明县| 胶州市| 南通市| 五大连池市| 静海县| 库尔勒市| 泽库县| 浦北县| 将乐县| 靖宇县| 连山| 江孜县| 佛冈县| 西乌珠穆沁旗| 兴化市| 格尔木市| 木兰县| 延川县| 凤山县| 新干县| 青海省| 昌邑市| 蓝田县| 子长县| 荃湾区| 高安市| 红原县| 成安县|