大家来看看哪错了

P1319 压缩技术

zzm1118 @ 2024-02-01 11:30:12

#include<bits/stdc++.h>
using namespace std;
int cnt,cnta,cntc,n,shuju[40010],cot[40010],num;
bool panduan=0;
int main(){
    cin>>n;
    cnta=n*n;
    while(cnt==cnta){
        cin>>shuju[++num];
        cnt+=shuju[num];
    }
    for(int x=1;x<=num;x++,panduan-=true)
        for(int y=1;y<=shuju[x];y++)
            cot[++cntc]=panduan;
    for(int x=1;x<=n;x++){
        for(int y=1;y<=n;y++){
            cout<<cot[(x-1)*n+y];
        }
        cout<<endl;
    }
    return 0;
}

by zzm1118 @ 2024-02-01 11:31:53

样例输入:7 3 1 6 1 6 4 3 1 6 1 6 1 3 7

样例输出:

0000000

0000000

0000000

0000000

0000000

0000000

0000000


|