最近碰到了一种取余的方式,采用位运算: if(k % 2 ==1) //Bad if(k & 0x01) //Good 刷一道题目,试一试效果,可能不太严谨 class Solution { static bool camp(int a,int b) { return abs(a)>abs(b); } public: int largestSumAfterKNegations(vector<int>& nums, int k) { //为什么不直接使用sort排序呢? ...