摘要:
class Solution { public: int reverse(int x) { // cout << 1111 << endl; long long ret = 0; long long y = x; int f = 0; if(y < 0) f = 1, y = -y; // cout 阅读全文
摘要:
/* // Definition for Employee. class Employee { public: int id; int importance; vector<int> subordinates; }; */ class Solution { public: int vis[10010 阅读全文
摘要:
map映射一下就好了 class Solution { public: // const int maxn = 30010; int vis[30010]; map<int, int> M; int singleNumber(vector<int>& nums) { int n = nums.siz 阅读全文
摘要:
抽象为把序列分成D段,求和最大的段的最小值 下界为最大值,上界为序列和,二分结果,每次去验证是否合适即可 class Solution { public: int shipWithinDays(vector<int>& weights, int D) { int total = 0; int max 阅读全文