liuyi0905 @ 2023-01-14 20:23:08
#include<bits/stdc++.h>
using namespace std;
int main(){
int cnt=0,sum=-1;
char a[400001];
while(cin>>a[++cnt]);
cout<<sqrt(cnt-1)<<" ";
for(int i=1;i<=cnt;i++){
sum++;
if(a[i-1]!=a[i]&&i!=1){
cout<<sum<<" ";
sum=0;
}
}
return 0;
}
???
by lccve @ 2023-01-14 20:37:52
看题解的第一个说明的很清楚了