Sun13 @ 2024-11-05 14:26:43
RT,20pts,#6、#7 AC
#include<bits/stdc++.h>
using namespace std;
string s;
int main(){
cin>>s;
int n=s.size();
for(int i=2; i<=n; i++){
string x;
cin>>x;
s+=x;
}
printf("%d ",n);
int l=0,r=0;
while(r!=n*n-1)
if(s[l]==s[r])
r++;
else{
printf("%d ",r-l);
l=r;
}
printf("%d\n",n*n-l);
return 0;
}