2 条题解
-
0
Guest
-
0
666#include<bits/stdc++.h> using namespace std; int main() { /*ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);*/ string a; bool b['z'+1]={false}; cin>>a; int l=0,r=1,x=1; b[a[0]]=true; while(r<a.size()){ if(b[a[r]]==false){ b[a[r]]=true; x=max(r++-l,x); } else{ b[a[l]]=false; x=max(r-l++,x); } } cout<<x; return 0; }
信息
- ID
- 911
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 8
- 标签
- (无)
- 递交数
- 32
- 已通过
- 6
- 上传者