都说小镇的切糕贵
思路:尺取法,双指针
//#pragma GCC optimize(2) //#pragma GCC optimize(3,"Ofast","inline") #include#define int long long #define fi first #define se second #define pb push_back #define pii pair #define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); using namespace std; const int inf=2e18+100; const int maxn=2e5+100; char a[maxn]; map mp; signed main() { int n; cin>>n; cin>>(a+1); int m=0; for(int i=1;i<=n;i++) { if(mp[a[i]]==0)m++; mp[a[i]]=1; } mp.clear(); int ans=inf,l=1,r=1,now=1; mp[a[1]]=1; for(l=1;l<=n;l++) { while(r



