摘要:
class Solution { public: int getMaxValue(vector<vector<int>>& grid) { int n=grid.size(),m=grid[0].size(); vector<vector<int>> f(n,vector<int> (m,0));/ 阅读全文
摘要:
class Solution { public: int digitAtIndex(int n) { if(!n) return 0; long long start=1,len=1,cnt=1;//记录区间的起始位置,记录区间长度,cnt记录当前是几位数 //往后走,跨度为一个区间 while(1 阅读全文
摘要:
class Solution { public: int numberOf1Between1AndN_Solution(int n) { vector<int> q; do { q.push_back(n%10); n/=10; }while(n); int res=0; for (int i = 阅读全文
摘要:
class Solution { public: int maxSubArray(vector<int>& nums) { int n=nums.size(),res=-0x3f3f3f3f; for (int i = 0; i < n;)//枚举以i为起点的区间 { int j=i,sum=0; 阅读全文