【尺取法】总结
尺取法解题步骤:
head=tail=0;
while(1){
①while(当前区间不满足约束&&tail<n) {tail后移;更新区间信息;}
②if(当前区间不满足约束) break;
③更新ans;
④head后移;更新区间信息;}
——The Solution By AutSky_JadeK From UESTC
转载请注明出处:http://www.cnblogs.com/autsky-jadek/
尺取法解题步骤:
head=tail=0;
while(1){
①while(当前区间不满足约束&&tail<n) {tail后移;更新区间信息;}
②if(当前区间不满足约束) break;
③更新ans;
④head后移;更新区间信息;}