题解

94 条题解

  • 0
    @ 2013-10-31 21:42:19

    var
    n,i,j,k,max,hang,lie,m,num:longint;
    niu:array[0..7,0..8]of char;
    a:array[0..51,0..51]of longint;
    b:array[0..1000,0..1000]of char;
    procedure print(x,y,num:longint);
    var
    i,j,k,CEO,CAO:longint;
    begin
    for k:=1 to num do
    begin
    CEO:=hang-(k-1)*3-(n-x)*2-6;
    CAO:=lie-(m-y+1)*4-x*2-1;

    for i:=hang-(k-1)*3-(n-x)*2 downto hang-(k-1)*3-(n-x)*2-5 do
    for j:=lie-(m-y+1)*4-x*2 to lie-(m-y+1)*4-x*2+6 do
    begin
    if(niu[i-CEO,j-CAO]='.')then continue;
    b[i,j]:=niu[i-CEO,j-CAO];
    end;
    end;
    end;
    procedure init;
    begin
    readln(n,m);
    for i:=1 to n do
    begin
    for j:=1 to m do
    begin
    read(a[i,j]);
    if(a[i,j]>max)then
    begin
    max:=a[i,j];
    if(2*(n-i+1)+3*max+1>hang)then
    hang:=2*(n-i+1)
    +3*max+1;
    end;
    end;
    readln;
    end;
    niu[1,1]:='.';
    niu[1,2]:='.';
    niu[1,3]:='+';
    niu[1,4]:='-';
    niu[1,5]:='-';
    niu[1,6]:='-';
    niu[1,7]:='+';

    niu[2,1]:='.';
    niu[2,2]:='/';
    niu[2,3]:=' ';
    niu[2,4]:=' ';
    niu[2,5]:=' ';
    niu[2,6]:='/';
    niu[2,7]:='|';

    niu[3,1]:='+';
    niu[3,2]:='-';
    niu[3,3]:='-';
    niu[3,4]:='-';
    niu[3,5]:='+';
    niu[3,6]:=' ';
    niu[3,7]:='|';

    niu[4,1]:='|';
    niu[4,2]:=' ';
    niu[4,3]:=' ';
    niu[4,4]:=' ';
    niu[4,5]:='|';
    niu[4,6]:=' ';
    niu[4,7]:='+';

    niu[5,1]:='|';
    niu[5,2]:=' ';
    niu[5,3]:=' ';
    niu[5,4]:=' ';
    niu[5,5]:='|';
    niu[5,6]:='/';
    niu[5,7]:='.';

    niu[6,1]:='+';
    niu[6,2]:='-';
    niu[6,3]:='-';
    niu[6,4]:='-';
    niu[6,5]:='+';
    niu[6,6]:='.';
    niu[6,7]:='.';

    lie:=4*m+2*n+1;
    for i:=1 to hang do
    for j:=1 to lie do b[i,j]:='.'
    end;
    procedure work;
    begin
    for i:=1 to n do
    for j:=1 to m do
    begin
    print(i,j,a[i,j]);
    end;
    for i:=1 to hang do
    begin
    for j:=1 to lie do write(b[i,j]);
    writeln;
    end;
    end;
    begin
    init;
    work;
    end.

  • 0
    @ 2013-08-04 10:09:02

    这题的坐标浪费了我好多时间,程序如下
    var
    a:array[1..500,1..500]of char;
    b:array[1..100,1..100]of integer;
    n,m,i,j,k,a1,a2,maxx,maxy,max,s:integer;

    procedure www;
    begin
    a[a2+5,a1+2]:='+';
    a[a2+5,a1+3]:='-';
    a[a2+5,a1+4]:='-';
    a[a2+5,a1+5]:='-';
    a[a2+5,a1+6]:='+';
    //a[a2+4,a1+1]:='/';
    a[a2+4,a1+2]:=' ';
    a[a2+4,a1+3]:=' ';
    a[a2+4,a1+4]:=' ';
    a[a2+4,a1+5]:='/';
    a[a2+4,a1+6]:='|';
    a[a2+3,a1]:='+';
    a[a2+3,a1+1]:='-';
    a[a2+3,a1+2]:='-';
    a[a2+3,a1+3]:='-';
    a[a2+3,a1+4]:='+';
    a[a2+3,a1+5]:=' ';
    a[a2+3,a1+6]:='|';
    a[a2+2,a1]:='|';
    a[a2+2,a1+1]:=' ';
    a[a2+2,a1+2]:=' ';
    a[a2+2,a1+3]:=' ';
    a[a2+2,a1+4]:='|';
    a[a2+2,a1+5]:=' ';
    a[a2+2,a1+6]:='+';
    a[a2+1,a1]:='|';
    a[a2+1,a1+1]:=' ';
    a[a2+1,a1+2]:=' ';
    a[a2+1,a1+3]:=' ';
    a[a2+1,a1+4]:='|';
    a[a2+1,a1+5]:='/';
    a[a2,a1]:='+';
    a[a2,a1+1]:='-';
    a[a2,a1+2]:='-';
    a[a2,a1+3]:='-';
    a[a2,a1+4]:='+';
    a[a2+4,a1+1]:='/';
    end;

    begin
    read(m,n);
    for i:=1 to m do
    for j:=1 to n do
    begin
    read(b[i,j]);
    if b[i,j]>max then max:=b[i,j];
    end;
    maxx:=n*4+m*2+1;
    maxy:=m*2+max*3+1;
    for i:=1 to maxy do
    for j:=1 to maxx do a[i,j]:='.';
    for k:=m-1 downto 0 do
    begin
    a1:=2*k+1;a2:=a1;
    for i:=0 to n-1 do
    begin
    a1:=a1+i*4;
    for j:=0 to b[m-k,i+1]-1 do
    begin
    a2:=a2+j*3;
    www;
    a2:=a2-j*3;
    end;
    a1:=a1-i*4;
    end;
    end;
    for i:=maxy downto 1 do
    begin
    s:=0;
    for j:=1 to maxx do
    begin
    if a[i,j]='.' then s:=s+1;
    end;
    if s=maxx then maxy:=maxy-1
    else break;
    end;
    for i:=maxy downto 1 do
    begin
    writeln;
    for j:=1 to maxx do write(a[i,j]);
    end;
    end.

  • 0
    @ 2013-07-22 20:38:01

    终于有个1AC的了~~~
    先求出总画布的长和宽,然后从左到右,从远到近,从下到上地画方块。

    #include <stdio.h>
    #define max(a,b) (a)>(b)?(a):(b)
    #define M 50
    #define N 50

    int n, m;
    int i, j, k;
    int p, q;
    int width, height;
    int hei[M][N];
    char canvas[900][900];

    void draw(int x, int y)
    {
    int i, j;
    for(i = y + 1; i < y + 4; i++)
    canvas[x][i] = canvas[x - 3][i] = canvas[x - 5][i + 2] = '-';
    for(i = x - 1; i > x - 3; i--)
    canvas[i][y] = canvas[i][y + 4] = canvas[i - 2][y + 6] = '|';
    for(i = x - 1; i > x - 3; i--)
    for(j = y + 1; j < y + 4; j++)
    canvas[i][j] = ' ';
    for(i = x - 2; i > x - 4; i--)
    canvas[i][y + 5] = ' ';
    for(i = y + 2; i < y + 5; i++)
    canvas[x - 4][i] = ' ';
    canvas[x][y] = canvas[x - 3][y] = canvas[x][y + 4] = canvas[x - 3][y + 4] = '+';
    canvas[x - 4][y + 1] = canvas[x - 4][y + 5] = canvas[x - 1][y + 5] = '/';
    canvas[x - 5][y + 2] = canvas[x - 5][y + 6] = canvas[x - 2][y + 6] = '+';
    }

    int main()
    {
    scanf("%d%d", &m, &n);
    for(i = 1; i <= m; i++)
    for(j = 1; j <= n; j++)
    scanf("%d", &hei[i][j]);
    width = 4 * n + 1 + 2 * m;
    height = 0;
    for(i = 1; i <= m; i++)
    for(j = 1; j <= n; j++)
    height = max(height, hei[i][j] * 3 + 1 + 2 * (m - i) + 2);
    for(i = 1; i <= height; i++)
    for(j = 1; j <= width; j++)
    canvas[i][j] = '.';
    for(i = 1; i <= m; i++)
    for(j = 1; j <= n; j++)
    {
    for(k = 1; k <= hei[i][j]; k++)
    draw(height - 2 * (m - i) - ((k-1)*3), 4 * (j - 1) + 1 + (m - i) * 2);
    }
    for(p = 1; p <= height; p++)
    {
    for(q = 1; q <= width; q++)
    putchar(canvas[p][q]);
    putchar('\n');
    }
    return 0;
    }

  • 0
    @ 2012-10-28 12:11:02

    ├ 测试数据 01:答案正确... (0ms, 25028KB)

    ├ 测试数据 02:答案正确... (0ms, 25028KB)

    ├ 测试数据 03:答案正确... (0ms, 25028KB)

    ├ 测试数据 04:答案正确... (0ms, 25028KB)

    ├ 测试数据 05:答案正确... (0ms, 25028KB)

    ├ 测试数据 06:答案正确... (0ms, 25028KB)

    ├ 测试数据 07:答案正确... (0ms, 25028KB)

    ├ 测试数据 08:答案正确... (0ms, 25028KB)

    ├ 测试数据 09:答案正确... (0ms, 25028KB)

    ├ 测试数据 10:答案正确... (0ms, 25028KB)

    ---|---|---|---|---|---|---|---|-

    Accepted / 100 / 0ms / 25028KB

    不得不说这道题很费内存啊

    一开始没认真看题,以为长用一个'-',题里打'---|'是因为vijos显示的太小……

    于是对样例的时候发现很奇怪,才知道是用'---|'……

    思路:用两个变量记录最大输出范围

    用一个字符串常量数组表示一块积木

    初始化map='.'

    之后用5重循环把map有积木的地方填满

    最后输出

  • 0
    @ 2010-03-06 16:18:34

    //水题秒杀

    var a:array [1..1000,1..1000] of char;

    b:array [1..1000,1..1000] of integer;

    f,max,maxi,maxj,h,i,j,k,l,m,n,i1,j2,s,t:integer;

    a1,a2,a3,a4:integer;

    begin

    readln(m,n);

    max:=0;

    for i:=m downto 1 do

    for j:=1 to n do

    begin

    read(b);

    if b>max then max:=b;

    end;

    for i:=1 to 1000 do

    for j:=1 to 1000 do

    a:='.';

    for i:=m downto 1 do

    for j:=1 to n do

    begin

    for k:=1 to b do

    begin

    h:=3*max+3-((k-1)*3)+(m-i)*2;

    l:=(j-1)*4+1+(i-1)*2;

    a[h,l]:='+';

    a[h,l+1]:='-';

    a[h,l+2]:='-';

    a[h,l+3]:='-';

    a[h,l+4]:='+';

    a[h-1,l]:='|';

    a[h-1,l+1]:=' ';

    a[h-1,l+2]:=' ';

    a[h-1,l+3]:=' ';

    a[h-1,l+4]:='|';

    a[h-1,l+5]:='/';

    a[h-2,l]:='|';

    a[h-2,l+1]:=' ';

    a[h-2,l+2]:=' ';

    a[h-2,l+3]:=' ';

    a[h-2,l+4]:='|';

    a[h-2,l+5]:=' ';

    a[h-2,l+6]:='+';

    a[h-3,l]:='+';

    a[h-3,l+1]:='-';

    a[h-3,l+2]:='-';

    a[h-3,l+3]:='-';

    a[h-3,l+4]:='+';

    a[h-3,l+5]:=' ';

    a[h-3,l+6]:='|';

    a[h-4,l+1]:='/';

    a[h-4,l+2]:=' ';

    a[h-4,l+3]:=' ';

    a[h-4,l+4]:=' ';

    a[h-4,l+5]:='/';

    a[h-4,l+6]:='|';

    a[h-5,l+2]:='+';

    a[h-5,l+3]:='-';

    a[h-5,l+4]:='-';

    a[h-5,l+5]:='-';

    a[h-5,l+6]:='+';

    end;

    end;

    for i:=1 to 1000 do

    begin

    f:=0;

    for j:=1 to 1000 do

    if a[j,i]'.' then f:=1;

    if f=1 then

    begin

    a1:=i;

    break;

    end;

    end;

    for i:=500 downto 1 do

    begin

    f:=0;

    for j:=1 to 800 do

    if a[j,i]'.' then f:=1;

    if f=1 then

    begin

    a2:=i;

    break;

    end;

    end;

    for i:=300 downto 1 do

    begin

    f:=0;

    for j:=1 to 300 do

    if a'.' then f:=1;

    if f=1 then

    begin

    a3:=i;

    break;

    end;

    end;

    for i:=1 to 300 do

    begin

    f:=0;

    for j:=1 to 300 do

    if a'.' then f:=1;

    if f=1 then

    begin

    a4:=i;

    break;

    end;

    end;

    for i:=a4 to a3 do

    begin

    for j:=a1 to a2 do

    write(a);

    writeln;

    end;

    end.

  • 0
    @ 2009-11-03 22:22:02

    .....样例输出错啦貌似。。

  • 0
    @ 2009-10-29 19:13:05

    庆祝一下我是第 666 个通过的哈哈。

    真的被这题的坐标搞晕了.,..

    60几行的程序,费了老半天的劲

    program P1497;

    const jm:array[1..6] of string[8]=('==+---|+',

    '=/ /|',

    '+---|+ |',

    '| | +',

    '| |/=',

    '+---|+==');

    var m,n,maxx,maxy,minx,miny:longint;

    pic:array[0..5001,0..5001]of char;

    procedure draw(x,y:longint);

    var i,j,x1,y1:longint;

    begin

    x1:=x+5; y1:=y;

    for i:=1 to 6 do

    begin

    for j:=1 to 7 do

    if jm[i][j]'=' then

    begin

    y1:=j+y-1;

    pic[x1,y1]:=jm[i][j];

    end;

    dec(x1);

    end;

    if x1maxy then maxy:=y1;

    end;

    procedure work;

    var i,j,k,l,x,tx,y,i1,j1:longint;

    begin

    fillchar(pic,sizeof(pic),'.');

    maxx:=-99999;

    maxy:=-99999;

    minx:=maxlongint;

    miny:=maxlongint;

    readln(m,n);

    x:=2*m-2;

    for i:=1 to m do

    begin

    y:=(n-i+1)*2;

    for j:=1 to n do

    begin

    read(k); tx:=x;

    if ymaxx then maxx:=tx;

    inc(y,4);

    end;

    dec(x,2)

    end;

    for i:=maxx+2 downto 0 do

    begin

    for j:=miny to maxy+2 do write(pic);

    writeln;

    end;

    readln;

    readln;

    end;

    begin

    work;

    end.

  • 0
    @ 2009-10-28 20:19:02

    program wx;

    const ss:array[1..6]of string=

    ('11+---|+',

    '1/ /|',

    '+---|+ |',

    '| | +',

    '| |/1',

    '+---|+11');

    var i,j,k,m,n,p,q,u,v:longint;

    s:array[1..1000,1..500]of char;

    a:array[1..100,1..100]of longint;

    function max(x,y:longint):longint;

    begin

    if x>y then exit(x)

    else exit(y);

    end;

    procedure ins(x,y:longint);

    begin

    for u:=1 to 6 do

    for v:=1 to 7 do

    if ss'1' then s[x+u-1,y+v-1]:=ss;

    end;

    begin

    readln(n,m);

    for i:=1 to n do

    begin

    for j:=1 to m do

    read(a);

    readln;

    end;

    for i:=1 to n do

    for j:=1 to m do

    p:=max(p,2*(n-i)+3*a+3);

    q:=4*m+2*n+1;

    for i:=1 to p do

    for j:=1 to q do

    s:='.';

    for i:=1 to n do

    for j:=1 to m do

    for k:=1 to a do

    ins(p-2*(n-i)-3*k-2,4*j+2*(n-i)-3);

    for i:=1 to p do

    begin

    for j:=1 to q do

    write(s);

    writeln;

    end;

    end.

  • 0
    @ 2009-10-26 10:57:33

    program lititu;

    var a:array [1..5000,1..5000] of char;

    d:array [1..6] of string;

    f:array [1..50,1..50] of longint;

    n,m,i,j,l,h,x,y,g,maxn,maxm,k:longint;

    begin

    readln(n,m);

    for i:=1 to n do

    begin

    for j:=1 to m do read(f);

    readln;

    end;

    d[1]:='..+---|+';

    d[2]:='./ /|';

    d[3]:='+---|+ |';

    d[4]:='| | +';

    d[5]:='| |/.';

    d[6]:='+---|+..';

    fillchar(a,sizeof(a),'.');

    for l:=1 to m do

    begin

    x:=(n-1)*2+1;

    y:=(l-1)*4+x;

    if y+6>maxm then maxm:=y+6;

    for h:=1 to n do

    begin

    g:=x+5;

    for k:=1 to f[h,l] do

    begin

    for i:=g downto g-5 do

    for j:=y to y+6 do

    if d[g-i+1][j-y+1]'.' then a:=d[g-i+1][j-y+1];

    g:=g+3;

    end;

    if g-3>maxn then maxn:=g-3;

    x:=x-2;y:=y-2;

    end;

    end;

    for i:=maxn downto 1 do

    begin

    for j:=1 to maxm do write(a);

    writeln;

    end;

    end.

    ...算短了吧?汗。。

  • 0
    @ 2009-10-25 15:04:31

    不小心将纵排和横排弄反了,害我浪费了好多时间

  • 0
    @ 2009-10-25 00:04:57

    /*

    ID: talenth1

    PROG: drawing

    LANG: C++

    */

    #include

    #include

    #include

    #include

    const int maxn=101,

    maxmap=1000;

    int m,n,hm=0,lm=0,hi[maxn][maxn];

    char map[maxmap][maxmap];

    char tmp[10][10]={"+---|+","| |","| |","+---|+"};

    char tmp1[10][10]={" +"," |"," |","+---|+"};

    void datain()

    {

    scanf("%d%d",&m,&n);

    for(int i=m;i>=1;i--)

    for(int j=1;jlm)lm=l4;

    if(h4>hm)hm=h4;

    memcpy(&map[l3],&tmp1[0],5*sizeof(char));//back

    memcpy(&map[l1],&tmp[0],5*sizeof(char));//front

    for(int i=1;i

  • 0
    @ 2009-10-24 20:40:11

    #include

    int m,n,i,j,k;

    int row,col,max=-1;

    int space[51][51];

    char draw[1000][1000];

    int lie,hang,lie1,hang1;

    void drawing(int row,int col);

    int main(){

    scanf("%d%d",&m,&n);

    for(i=1;i

  • 0
    @ 2009-10-24 17:38:20

    Accepted 有效得分:100 有效耗时:0ms

    太爽了,半小时不到1次AC~~

  • 0
    @ 2009-10-24 11:08:29

    编译通过...

    ├ 测试数据 01:答案正确... 0ms

    ├ 测试数据 02:答案正确... 0ms

    ├ 测试数据 03:答案正确... 0ms

    ├ 测试数据 04:答案正确... 0ms

    ├ 测试数据 05:答案正确... 0ms

    ├ 测试数据 06:答案正确... 0ms

    ├ 测试数据 07:答案正确... 0ms

    ├ 测试数据 08:答案正确... 0ms

    ├ 测试数据 09:答案正确... 0ms

    ├ 测试数据 10:答案正确... 0ms

    ---|---|---|---|---|---|---|---|-

    Accepted 有效得分:100 有效耗时:0ms

    ---|---|---|---|---|---|---|---|---|---|---|

    1次AC!

    就是要处理好每个正方体最左下角的坐标 这个比较有难度 空间要求比较高

    晒晒程序

    ---|---|---|---|---|---|---|---|---|-

    Var

    a:array [-200..200,-200..200] of Char;

    z:array [1..1000,1..1000] of Longint;

    x1,x2,y1,y2,i,j,k,n,m:longint;

    Function pdh(x:Longint):Boolean;

    Var

    i:Longint;

    t:Boolean;

    Begin

    For i:=-200 to 200 Do If a[x,i]'.' Then Exit(False);

    Exit(True);

    End;

    Function pdl(y:Longint):Boolean;

    Var

    i:Longint;

    t:Boolean;

    Begin

    For i:=-200 to 200 Do If a'.' Then Exit(False);

    Exit(True);

    End;

    Procedure hh(x,y,gao:Longint);

    Var

    i,j,k:Longint;

    Begin

    For i:=1 to gao Do Begin

    a[x,y]:='+';

    a[x,y+4]:='+';

    For j:=1 to 3 Do a[x,y+j]:='-';

    Dec(x);

    a[x,y]:='|';

    a[x,y+4]:='|';

    a[x,y+5]:='/';

    For j:=1 to 3 Do a[x,y+j]:=' ';

    Dec(x);

    a[x,y]:='|';

    a[x,y+4]:='|';

    a[x,y+5]:=' ';

    a[x,y+6]:='+';

    For j:=1 to 3 Do a[x,y+j]:=' ';

    Dec(x);

    a[x,y]:='+';

    a[x,y+4]:='+';

    a[x,y+5]:=' ';

    a[x,y+6]:='|';

    For j:=1 to 3 Do a[x,y+j]:='-';

    a[x-1,y+1]:='/';

    a[x-1,y+5]:='/';

    a[x-1,y+6]:='|';

    For j:=1 to 3 do a[x-1,y+1+j]:=' ';

    a[x-2,y+2]:='+';

    a[x-2,y+6]:='+';

    For j:=1 to 3 do a[x-2,y+2+j]:='-';

    End;

    End;

    Begin

    fillchar(a,sizeof(a),'.');

    Read(m,n);

    For i:=m downto 1 Do

    begin

    For j:=1 to n Do Read(z);

    readln;

    end;

    For i:=m downto 1 Do

    For j:=1 to n Do

    hh(0-2*(i-1)+1,4*(j-1)+(2*(i-1)),z);

    x1:=-100;

    While pdh(x1) Do Inc(x1);

    x2:=x1;

    While not pdh(x2) Do Inc(x2);

    y1:=-100;

    While pdl(y1) Do Inc(y1);

    y2:=y1;

    While not pdl(y2) Do Inc(y2);

    For i:=x1 to x2-1 Do Begin

    For j:=y1 to y2-1 Do write(a);

    writeln;

    End;

    End.

  • 0
    @ 2009-10-23 20:57:49

    const

    b:array [1..6,1..7] of char= ((chr(0),chr(0),'+','-','-','-','+'),

    (chr(0),'/',' ',' ',' ','/','|'),

    ('+','-','-','-','+',' ','|'),

    ('|',' ',' ',' ','|',' ','+'),

    ('|',' ',' ',' ','|','/',chr(0)),

    ('+','-','-','-','+',chr(0),chr(0)));

    var

    m,n,i,j,k,max,maxx,maxy,x,y,x1,y1,px,py:longint;

    ans:array[1..200,1..200] of longint ;

    c:array [1..200,1..200] of char;

    begin

    read(m,n);

    for i := 1 to 200 do

    for j := 1 to 200 do

    c:='.';

    for i := 1 to m do

    for j := 1 to n do

    begin

    read(ans);

    if ans>max then max:=ans;

    end;

    maxx:=0;

    maxy:=0;

    for i := 1 to max do

    for j:= 1 to m do

    for k:=1 to n do

    if ans[j,k]>=i then

    begin

    x:=m-j+1;

    y:=k;

    px:=1+(i-1)*3+(x-1)*2;

    py:=1+(y-1)*4+(x-1)*2;

    if px>maxx then maxx:=px;

    if py>maxy then maxy:=py;

    for x1 := 1 to 6 do

    for y1:=1 to 7 do

    if b[x1,y1]chr(0) then

    c[px+6-x1,py+y1-1]:=b[x1,y1];

    end;

    for i:= maxx+5 downto 1 do

    begin

    for j:=1 to maxy+6 do

    write(c);

    writeln;

    end;

    end.

    噢噢噢噢!庆贺2008年全通!

  • 0
    @ 2009-10-23 20:36:19

    哎哎,只是数学题而已。。但也有些难度。!

  • 0
    @ 2009-10-22 21:11:38

    立体图真美观~

    编译通过...

    ├ 测试数据 01:答案正确... 0ms

    ├ 测试数据 02:答案正确... 0ms

    ├ 测试数据 03:答案正确... 0ms

    ├ 测试数据 04:答案正确... 0ms

    ├ 测试数据 05:答案正确... 0ms

    ├ 测试数据 06:答案正确... 0ms

    ├ 测试数据 07:答案正确... 0ms

    ├ 测试数据 08:答案正确... 0ms

    ├ 测试数据 09:答案正确... 0ms

    ├ 测试数据 10:答案正确... 0ms

    ---|---|---|---|---|---|---|---|-

    Accepted 有效得分:100 有效耗时:0ms

  • 0
    @ 2009-10-21 18:51:53

    太感动了!!!!!!!!!!!!!!

    花了我2h的猥琐题啊!!!!!!!!!!!!

    1次AC

  • 0
    @ 2009-10-20 21:17:20

    考试的时候,看起来很难,一听老师讲,发现真的很简单啊!

    Const

    draw: Array [1..6,1..7]of char=(('*','*','+','-','-','-','+'),

                       ('*','/',' ',' ',' ','/','|'),

                       ('+','-','-','-','+',' ','|'),

                       ('|',' ',' ',' ','|',' ','+'),

                       ('|',' ',' ',' ','|','/','*'),

                       ('+','-','-','-','+','*','*'));

    Var

    max, maxx, maxy, m, n, i, j, k, x, y, px, py, x1, y1: Longint;

    ans: Array [1..1000, 1..1000] Of Char;

    a: Array [1..50, 1..50] Of Longint;

    Begin

    ReadLn(m, n);

    max := 0;

    For i:=1 To m Do Begin

      For j:=1 To n Do Begin

       Read(a[i, j]);

       If a[i, j]>max Then max := a[i, j];

      End;

      ReadLn;

    End;

    For i:=1 To 1000 Do

      For j:=1 To 1000 Do

       ans[i, j] := '.';

    maxx := 0;

    maxy := 0;

    For k:=1 To max Do

      For i:=1 To m Do

       For j:=1 To n Do

        If a[i, j]>=k Then Begin

         x := m - i + 1;

         y := j;

         px := 1 + (k-1) * 3 + (x-1) * 2;

         py := 1 + (y-1) * 4 + (x-1) * 2;

         If px>maxx Then maxx := px;

         If py>maxy Then maxy := py;

         For x1:=1 To 6 Do

          For y1:=1 To 7 Do

           If draw[x1, y1]'*' Then

            ans[px+6-x1, py+y1-1] := draw[x1, y1];

        End;

    For i:=maxx+5 Downto 1 Do Begin

      For j:=1 To maxy+6 Do

       Write(ans[i, j]);

      WriteLn;

    End;

    End.

  • 0
    @ 2009-10-20 13:54:07

    var

    b : array[1..50,1..50]of longint;

    a :array[1..1000,1..1000]of char;

    k,l,n,m,i,j,y,tx,ty :longint;

    procedure d(y,x:longint);

    begin

    a[y-5,x+2]:='+';a[y-5,x+3]:='-';a[y-5,x+4]:='-';a[y-5,x+5]:='-';a[y-5,x+6]:='+';

    a[y-4,x+1]:='/';a[y-4,x+2]:=' ';a[y-4,x+3]:=' ';a[y-4,x+4]:=' ';a[y-4,x+5]:='/';a[y-4,x+6]:='|';

    a[y-3,x]:='+';a[y-3,x+1]:='-';a[y-3,x+2]:='-';a[y-3,x+3]:='-';a[y-3,x+4]:='+';a[y-3,x+5]:=' ';a[y-3,x+6]:='|';

    a[y-2,x]:='|';a[y-2,x+1]:=' ';a[y-2,x+2]:=' ';a[y-2,x+3]:=' ';a[y-2,x+4]:='|';a[y-2,x+5]:=' ';a[y-2,x+6]:='+';

    a[y-1,x]:='|';a[y-1,x+1]:=' ';a[y-1,x+2]:=' ';a[y-1,x+3]:=' ';a[y-1,x+4]:='|';a[y-1,x+5]:='/';

    a[y,x]:='+';a[y,x+1]:='-';a[y,x+2]:='-';a[y,x+3]:='-';a[y,x+4]:='+';

    if x+6>l then l:=x+6;

    if y-51 then ty:=ty-3;

    d(ty,tx);

    end;

    ty:=1000-2*(i-1);

    end;

    end;

    for i:=k to 1000 do

    begin

    for j:=1 to l do

    write(a);

    writeln;

    end;

    end.

信息

ID
1497
难度
2
分类
字符串 | 模拟 点击显示
标签
递交数
1925
已通过
1116
通过率
58%
被复制
18
上传者