LC.P2178[拆分成最多数目的正偶数之和] 方法一:贪心123456789101112class Solution { public List<Long> maximumEvenSplit(long finalSum) { List<Long> ans = new ArrayList<>(); if (finalSum % 2 == 1) return ans; for (long i = 2; i <= finalSum; i += 2) { ans.add(i); finalSum -= i; } ans.add(ans.remove(ans.size() - 1) + finalSum); return ans; }} 时间复杂度:$O(\sqrt {finalSum})$ 空间复杂度:$O(1)$