#include <bits/stdc++.h>
using namespace std;
char a,b='0';
int n,ans[1000001],zz=1;
int main(){
while(cin>>a)
{
n++;
if(a==b){ ans[zz]++;}
else{ zz++; ans[zz]++; b=a;}
}
cout<<sqrt(n);
for(int i=1 ; i<=zz ; i++)
cout<<" "<<ans[i];
}

0 comments

No comments so far...

Information

ID
435
Time
1000ms
Memory
256MiB
Difficulty
6
Tags
(None)
# Submissions
84
Accepted
23
Uploaded By