| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 111315 | 凌艺樽 | 划分字母区间 | C++ | Compile Error | 0 | 0 MS | 0 KB | 533 | 2023-11-19 20:36:01 |
#include <bits/stdc++.h> using namespace std; const int N=1e7+10; const int INF=0x3f3f3f3f; string s; int a[30],end=0,start=0; bool c[30]; int main() { getline(cin,s); int len=s.size(); for(int i=0;i<len;i++) { a[s[i]-'a'+1]++; } for(int i=0;i<len;i++) { a[s[i]-'a'+1]--; c[s[i]-'a'+1]=1; end++; bool f=1; for(int j=1;j<=26;j++) { if(c[j]==1 && a[j]>0) { f=0; } } if(f) { cout<<end-start<<" "; start=end; memset(c,0,sizeof 0); } } return 0; }