参考网址
https://www.luogu.com.cn/problem/P2556
#include#include using namespace std; //处理中中间的位图(补充说明:题目中提到连续1或0的个数不超过128即可以用7个位来存,所以不用考虑count>128的情况) void HandleBitMap(unsigned char &x,unsigned char &head,unsigned char &count) { for(int i=0;i<8;i++,x=x<<1) { if(head==0x80) { if( (x & 0x80) == 0x80) { count++; continue; } else { unsigned char data=(head|count); //cout<<"head: "<<"1 count: "<<(int)count< >n; for(int i=0;i >则容易出错,因为它默认输入为字符了 scanf("%d",&a[i]); //cout<<(int)a[i]<



