Joink @ 2023-08-28 14:11:33
#include<iostream>
#include<cstring>
using namespace std;
int main()
{
int a[400001],j=1,n=2,s=1;
char r;
memset(a,-1,sizeof(a));
for (int i=1; i<=n-1; i++)
{
r=getchar();
j=1;
while (r!='\n')
{
a[s]=r-48;
r=getchar();
j++; s++;
if (j>=n) n=j;
}
}
n=n-1; s=s-1;
cout<<n<<' ';
if (a[1]==1) cout<<0<<' ';
s=1;
for (int i=2; i<=n*n; i++)
{
if (a[i]==a[i-1]) s++;
else
{
cout<<s<<' ';
s=1;
}
}
cout<<s;
return 0;
}
by Joink @ 2023-08-28 14:11:50
来个大佬帮忙看下
by bookchong @ 2023-08-28 14:52:19
哥们,在洛谷也能运行,但是你做错了。如果不能运行它会提示你编译失败。
by SuperChao @ 2023-08-28 15:59:53
楼上正解,程序有问题,不是编译器的原因