【尺取法】总结

尺取法解题步骤:

head=tail=0;

while(1){

①while(当前区间不满足约束&&tail<n) {tail后移;更新区间信息;}

②if(当前区间不满足约束) break;

③更新ans;

④head后移;更新区间信息;}

原文地址:https://www.cnblogs.com/autsky-jadek/p/4077780.html