标签:clu map str style main out cst using max
1 #include<iostream> 2 #include<cstdio> 3 using namespace std; 4 const int maxn=5007; 5 int map[maxn][maxn],hei[maxn][maxn],h[maxn]; 6 int n,m,l,k,poi,hh,x,y,z; 7 int main(){ 8 cin>>n>>m;l=2*n+4*m+1; 9 for(int i=1;i<=n;i++) 10 for(int j=1;j<=m;j++){ 11 cin>>hei[i][j];h[i]=max(h[i],hei[i][j]); 12 } 13 for(int i=1;i<=n;i++){ 14 k=max(k,3*h[i]+1+2*(n-i+1)); 15 hh=max(hh,h[i]); 16 }//cout<<k<<" "<<l<<endl; 17 for(int i=1;i<=n;i++){ 18 for(int j=1;j<=m;j++){ 19 for(int kk=1;kk<=hh;kk++){ 20 if(!hei[i][j]) continue; 21 if(hei[i][j]){ 22 hei[i][j]--; 23 x=k-(n-i+1)*2-3*(kk-1);y=2*(j-1)+(n-i)*4+3;//cout<<" "<<i<<" "<<j<<" "<<x<<" "<<y<<" "<<kk<<endl; 24 map[x-3][y]=1;map[x-3][y+4]=1; 25 map[x-1][y-2]=1;map[x-1][y+2]=1; 26 map[x][y+4]=1; 27 map[x+2][y-2]=1;map[x+2][y+2]=1; 28 map[x-3][y+1]=2;map[x-3][y+2]=2;map[x-3][y+3]=2; 29 map[x-1][y-1]=2;map[x-1][y]=2;map[x-1][y+1]=2; 30 map[x+2][y-1]=2;map[x+2][y]=2;map[x+2][y+1]=2; 31 map[x-2][y-1]=3;map[x-2][y+3]=3;map[x+1][y+3]=3; 32 map[x][y-2]=4;map[x][y+2]=4;map[x+1][y-2]=4;map[x+1][y+2]=4; 33 map[x-2][y+4]=4;map[x-1][y+4]=4; 34 map[x-2][y]=5;map[x-2][y+1]=5;map[x-2][y+2]=5;map[x-1][y+3]=5; 35 map[x][y-1]=5;map[x][y]=5;map[x][y+1]=5;map[x][y+3]=5; 36 map[x+1][y-1]=5;map[x+1][y]=5;map[x+1][y+1]=5; 37 } 38 } 39 } 40 } 41 for(int i=1;i<=k;i++){ 42 for(int j=1;j<=l;j++){ 43 if(map[i][j]==0) cout<<‘.‘; 44 if(map[i][j]==1) cout<<‘+‘; 45 if(map[i][j]==2) cout<<‘-‘; 46 if(map[i][j]==3) cout<<‘/‘; 47 if(map[i][j]==4) cout<<‘|‘; 48 if(map[i][j]==5) cout<<‘ ‘; 49 }cout<<endl; 50 } 51 return 0; 52 }
标签:clu map str style main out cst using max
原文地址:https://www.cnblogs.com/lcan/p/9749324.html