NCY @ 2019-02-15 10:10:58
#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int map[100000];
int main()
{
// freopen("1.in","r",stdin);
char t,l;
int n=0,top=1;
scanf("%c",&l);
map[0]=l-'0';
while(scanf("%c",&t)==1)
{
if(t=='1'||t=='0')
{
map[top]=t-'0';
++top;
}
}
n=sqrt(top);
printf("%d",n);
for(int i=1;i<=top;i++)
{
if(i==1&&map[1]==1)
{
printf(" 0");
}
// else
// {
l=map[i-1];
t=map[i];
int ans=1;
while(l==t)
{
ans++;
++i;
l=map[i-1];
t=map[i];
}
printf(" %d",ans);
// }
}
// for(int i=1;)
}
by 鸡蛋糕 @ 2019-02-15 10:44:32
你map好像不是字符,第11行的……
map[0]=l-'0';map