拓冰建站拓冰建站
首页 / 资讯中心 / 正文

leetcode 耗时100 1753. Maximum Score From Removing Stones

Problem: 1753. 移除石子的最大得分耗时100%数学题排序若a b c) return (a b);否则a, b剩下的要尽量相等所以答案是min(h, g) c;Codeclass Solution { public: int maximumScore(int a, int b, int c) { vectorint tr{a, b, c}; sort(tr.begin(), tr.end()); a tr[0]; b tr[1]; c tr[2]; if(a b c) return (a b); int k (a b - c); int h k / 2; int g k - h; return min(h, g) c; } };
分享:

看完干货,该让你的企业上线了

免费需求沟通 · 48 小时内出具建站方案 · 河南本地可上门