标签:count style 扫描 enc i++ syn size int public
1 static int wing=[]() 2 { 3 std::ios::sync_with_stdio(false); 4 cin.tie(NULL); 5 return 0; 6 }(); 7 8 class Solution 9 { 10 public: 11 int findLengthOfLCIS(vector<int>& nums) 12 { 13 int sz=nums.size(); 14 if(sz<2) 15 return sz; 16 int count=1; 17 int res=INT_MIN; 18 for(int i=1;i<sz;i++) 19 { 20 if(nums[i]>nums[i-1]) 21 count++; 22 else 23 { 24 res=max(res,count); 25 count=1; 26 } 27 } 28 return max(res,count); 29 } 30 };
扫描一遍,问题不大
674. Longest Continuous Increasing Subsequence
标签:count style 扫描 enc i++ syn size int public
原文地址:https://www.cnblogs.com/zhuangbijingdeboke/p/9159392.html