RE怎么回事?(C++代码)

P1319 压缩技术

已注销 jGVo%am^ @ 2021-06-06 11:50:23

#include<iostream>
#include<cstdio>
using namespace std;
int ans[40005];
int main(){
    int n;
    scanf("%d",&n);
    int a;
    int zoo=0;
    int cur=0;
    while(scanf("%d",&a)){
        for(int i=1;i<=a;i++) ans[i+cur]=zoo;
        cur+=a;
        if(zoo==0) zoo=1;
        else zoo=0;
    }
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            printf("%d",ans[(i-1)*n+j]);
        }
        printf("\n");
    }
    return 0;
}

by Ctjer @ 2021-06-06 11:52:58

再提交一边试试


by 已注销 jGVo%am^ @ 2021-06-06 11:56:22

@Tom90325 试过了


by Ctjer @ 2021-06-06 12:00:09

@jiziqian 坐下来,喝杯茶,等个两三个小时评测机就好了


by Astatinear @ 2021-06-06 12:00:43

@jiziqian 在while(scanf)这个地方 加一个!=EOF试一试


by Ctjer @ 2021-06-06 12:01:36

不能这么输入


by Astatinear @ 2021-06-06 12:01:54

改成 while(scanf("%d",&a)!=EOF)


by 已注销 jGVo%am^ @ 2021-06-06 12:04:41

@咸鱼吖 过了,谢谢


by Astatinear @ 2021-06-06 12:06:09

加了就对了


|