摘要: class Solution { public: static int cmp(vector<int> a, vector<int> b){ if(a[0] != b[0]) // 第一个元素不相等,按照从大到小排序, return a[0]>b[0]; else // 第一个元素相等,第二个元素按 阅读全文
posted @ 2021-07-28 15:45 三一一一317 阅读(25) 评论(0) 推荐(0)
摘要: class Solution { public: bool canPartition(vector<int>& nums) { int n = nums.size(); if(n<=1) // 数组长度小于等于1返回false return false; int sum = 0; for(int i 阅读全文
posted @ 2021-07-28 15:01 三一一一317 阅读(46) 评论(0) 推荐(0)