2019, XII Samara Regional Intercollegiate Programming Contest
A。双指针如果定义好l和r的含义就变得很好写了。#includeusingnamespacestd;typedeflonglongLL;constLLmaxn=500000+100;LLcolor[maxn],cnt[maxn],a[maxn],ans[maxn];intmain(){LLn;scanf("%I64d",&n);for(LLi=1;i0&&cnt[a[r]]>0)){r++;if(