求调,全WA

P1320 压缩技术(续集版)

dami826 @ 2022-12-29 15:40:55

#include<bits/stdc++.h>
using namespace std;
int A[40001];
int main(){
    int a,b=0,c=0,d=1;
    while(cin>>a){
        b++;
        if(a!=c){
            d++;
            c=a;
        }
        A[d]++;
    }
    A[0]=sqrt(b);
    for(int i=0;i<=d;i++){
        if(i!=0){
            printf(" ");
        }
        printf("%d",A[i]);
    }
    return 0;
}

by 编码落寞 @ 2022-12-29 16:03:01

你这么读,第一行会变成一个整数


by dami826 @ 2022-12-29 16:05:28

@planet_over_for_ever 那用什么呀(小萌新de好奇)


by dami826 @ 2022-12-29 16:06:02

@编码落寞 懂了


by ZQIN_P @ 2022-12-29 16:10:48

(我没读题,还得输出行数


by ZQIN_P @ 2022-12-29 16:11:06

溜了溜了


by dami826 @ 2022-12-29 16:11:58

@planet_over_for_ever ………………6


上一页 |