摘要: 最长上升子串(非dp版本) int j = 2; int ans = 1, cnt = 1; while(j <= n)//每次进while,第j个位置都准备开始判断 { if(x[j] >= x[j-1]) { ++cnt; } else { ans = max(ans, cnt); cnt = 阅读全文
posted @ 2020-12-01 23:43 .Ivorelectra 阅读(191) 评论(0) 推荐(0) 编辑