P1320求助,本地能过测试测试了极限数据也能过但是全WA
查看原帖
P1320求助,本地能过测试测试了极限数据也能过但是全WA
560814
anaoai楼主2021/12/6 19:13
#include <bits/stdc++.h>
using namespace std;
int main(){
	string longx;
	int cache=1;
	int chang=0;
	getline(cin,longx);
	chang=longx.length();
	int solve[50000];
	memset(solve,0,sizeof(solve));
	for(int i=0;i<chang;i++){
		solve[i]=longx[i]-'0';
	}
	for(int i=1;i<chang;i++){
		string ss;
		getline(cin,ss);
		for(int j=0;j<=chang;j++){
			solve[i*chang+j]=ss[j]-'0';
		}
	}
	/*for(int i=0;i<chang*chang;i++){
		cout<<solve[i];
	}*/
	cout<<chang<<" ";
	for(int i=1;i<=chang*chang;i++){
		if(solve[i]==solve[i-1]){
			cache++;
		}else{
			cout<<cache<<" ";
			cache=1;
		}
}
	return 0;
}
/*
0001000
0001000
0001111
0001000
0001000
0001000
1111111

7 3 1 6 1 6 4 3 1 6 1 6 1 3 7

00
00

2 4
*/
2021/12/6 19:13
加载中...