20分求助(P1320 压缩技术(续集版))

P1320 压缩技术(续集版)

lanmengfei @ 2023-04-05 13:08:56

贴代码:

#include<bits/stdc++.h>
using namespace std;
char c[200*200+5];
int n=0,x=1;
int main(){
    while (cin>>c[n++]);--n;
    cout<<sqrt(n)<<" ";
    bool ok=0;
    for (int i=0;i<n;i++){
        if (c[i]==c[i+1]){
            ++x;
        }
        else{
            cout<<x<<" ";
            x=1;
        }
    }
    return 0;
}

P1320 压缩技术 样例通过,自己出的数据也是对的,为什么只有20?QWQ


by Niehongyu2013 @ 2023-04-14 14:53:23

看看它吧https://cdn.luogu.com.cn/upload/image_hosting/hnu700uf.png


by lanmengfei @ 2023-04-15 09:28:09

@Niehongyu2013 9天猫离谱


|