题解

61 条题解

  • 4
    @ 2016-08-06 10:04:03
    #include <iostream>
    #include <cstdio>
    #include <cstring>
    #include <algorithm>
    #include <cmath>
    
    using namespace std;
    typedef long long lg;
    #define min(a,b) (a>b?b:a)
    #define max(a,b) (a>b?a:b)
    #define MAX 50001
    
    int n;
    char a[2000][2000];
    
    void build(int l,int r,int h)
    {
        if(l==r||h<=0||l<0||r<0) return;
        //cout<<l<<" "<<r<<" "<<h<<endl;
        if(r-l==3)
        {
            a[h][l+2]=a[h][l+1]='_';
            a[h-1][l+1]=a[h][l]='/';
            a[h-1][l+2]=a[h][r]='\\';
            return;
        }
        int m=(l+r)/2;
        build(l,m,h);
        build(m+1,r,h);
        int ll=(m+1+l)/2,rr=(m+r)/2;
        build(ll,rr,h-(rr-ll)/2-1);
    }
    
    int main(int argc, char** argv)
    {
        cin>>n;
        memset(a,' ',sizeof a);
        build(1,pow(2,n-1)*4,pow(2,n));
        for(int i=1;i<=pow(2,n);i++)
        {
            for(int j=1;j<=pow(2,n-1)*4;j++)
                cout<<a[i][j];
            cout<<endl; 
        }
        return 0;
    }
    
  • 3
    @ 2017-11-29 12:55:07
    #include<cstdio>
    #include<cmath>
    #include<cstring>
    #define min(a,b) (a>b?b:a)
    #define max(a,b) (a>b?a:b)
    #define MAX 50001
    int n;
    char a[2000][2000];
    void build(int l,int r,int h) {
        if(l==r||h<=0||l<0||r<0) return;
        if(r-l==3) {
            a[h][l+2]=a[h][l+1]='_';
            a[h-1][l+1]=a[h][l]='/';
            a[h-1][l+2]=a[h][r]='\\';
            return;
        }
        int m=(l+r)/2;
        build(l,m,h);
        build(m+1,r,h);
        int ll=(m+1+l)/2,rr=(m+r)/2;
        build(ll,rr,h-(rr-ll)/2-1);
    }
    int main(int argc, char** argv) {
        scanf("%d", &n);
        memset(a,' ',sizeof a);
        build(1,pow(2,n-1)*4,pow(2,n));
        for(int i=1; i<=pow(2,n); i++) {
            for(int j=1; j<=pow(2,n-1)*4; j++)
                printf("%c", a[i][j]);
            printf("\n");
        }
        return 0;
    }
    
  • 2
    @ 2018-03-30 10:32:47

    还可以的
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <math.h>
    char* f(int n)
    {
    char* p,*q;
    int i,j,L=pow(2,n+1),h=L/2;
    p=(char*)calloc(h*L, sizeof(char));
    for(i=0;i<L*h;i++)
    p[i]=' ';
    if(n>=2)
    {
    q=f(n-1);
    for(i=0;i<h/2;i++)
    for(j=0;j<L/2;j++)
    p[i*L+j+L/4]=p[(i+h/2)*L+j]=p[(i+h/2)*L+j+L/2]=q[i*L/2+j];
    }
    else
    {
    p[1]=p[4]='/';
    p[2]=p[7]='\';
    p[5]=p[6]='_';
    }
    return p;
    }

    int main()
    {
    int n;
    scanf("%d",&n);
    int i,j,L=pow(2,n+1),h=L/2;
    char *p;
    p=f(n);
    for(i=0;i<h;i++)
    {
    for(j=0;j<L;j++)
    printf("%c",p[i*L+j]);
    printf("\n");
    }

    }

  • 2
    @ 2017-05-08 12:32:16
    /*
    递归入门吧
    直接解决就好了
    不多说啥
    */
    #include <iostream>
    #include <cstdio>
    #include <algorithm>
    #include <cstring>
    using namespace std;   
    
    char a[1050][1050];
    
    void work(int n,int x,int y)
    {
        if(n==1)
        {
            a[x][y]=a[x-1][y+1]='/';
            a[x-1][y+2]=a[x][y+3]='\\';
            a[x][y+1]=a[x][y+2]='_';
            return;
        }
        else
        {
            work(n-1,x-(1<<n-1),y+(1<<(n-1)));
            work(n-1,x,y);
            work(n-1,x,y+(1<<n));
            return;
        }
    }
    int main()
    {
        int n,i,j;
        cin>>n;
        work(n,(1<<n),1);
        for(i=1;i<=(1<<n);i++)
        {
            for(j=1;j<=i+(1<<n);j++)
                if(a[i][j])cout<<a[i][j];else cout<<' ';
            cout<<endl;
        }
        return 0;
    }
    
  • 2
    @ 2017-01-19 21:51:07

    C++代码,
    希望对初学者有所帮助

    #include<iostream>
    #include<algorithm>
    #include<string>
    #include<cstdio>
    using namespace std;
    string s[2000];
    int sum;
    int n;
    void dfs(int);
    int main()
    {
    s[1]=" /\\ ";
    s[2]="/__\\";
    cin>>n;
    sum=1;
    for(int i=0;i<n;i++)
    sum<<=1;
    dfs(1);
    for(register int i=1;i<=sum;i++)
    cout<<s[i]<<endl;
    return 0;
    }
    void dfs(register int step)
    {
    if(step==n) return;
    register int a=1;
    for(register int i=0;i<step;i++)
    a<<=1;
    for(register int i=a+1;i<=a<<1;i++)
    s[i]=s[i-a]+s[i-a];
    for(register int i=1;i<=a;i++)
    for(register int j=0;j<a;j++)
    s[i]=" "+s[i]+" ";
    dfs(step+1);
    }

  • 2
    @ 2016-07-30 09:27:48

    递归,递归!!!!~~~~~
    ···c++
    #include<iostream>
    #include<cstdio>
    using namespace std;
    string s1=" /\ ",s2="/__\";
    string s[10005];
    int mi[15];
    void sanjiao(int up,int down,int x)
    {
    int i,j;
    if(x==1)
    {
    s[up]+=s1;
    s[down]+=s2;
    return;
    }
    else
    {
    for(i=1;i<=mi[x-1];i++)
    for(j=up;j<=up+mi[x-1]-1;j++)
    s[j]+=" ";
    sanjiao(up,up+mi[x-1]-1,x-1);
    for(i=1;i<=mi[x-1];i++)
    for(j=up;j<=up+mi[x-1]-1;j++)
    s[j]+=" ";
    sanjiao(up+mi[x-1],down,x-1);
    sanjiao(up+mi[x-1],down,x-1);
    return;
    }
    }
    int main()
    {
    int n,i;
    cin>>n;
    mi[0]=1;
    for(i=1;i<=10;i++)
    mi[i]=mi[i-1]*2;
    sanjiao(1,mi[n],n);
    for(i=1;i<=mi[n];i++)
    cout<<s[i]<<endl;
    return 0;
    }
    ···

  • 1
    @ 2019-11-27 16:51:15

    递归算法
    ```cpp
    #include <iostream>
    #include <math.h>
    #define N 5000
    using namespace std;
    char a[N][N];
    void Print(int n,int i,int j)
    {
    if(n==1)
    {
    a[i][j] = '/';
    a[i][j+1] = '_';
    a[i][j+2] = '_';
    a[i][j+3] = '\';
    a[i-1][j+1] = '/';
    a[i-1][j+2] = '\';
    return;
    }
    Print(n-1,i,j+1);
    Print(n-1,i,j+pow(2,n)+1);
    Print(n-1,i-pow(2,n-1),j+pow(2,n-1)+1);
    }

    int main()
    {
    int n;
    cin>>n;
    for(int i=0;i<pow(2,n+1)+n;i++)
    for(int j=0;j<pow(2,n+1)+n;j++)
    a[i][j] = ' ';
    Print(n,pow(2,n),0);
    for(int i=1;i<pow(2,n)+1;i++)
    {
    for(int j=n-1;j<pow(2,n+1)+n-1;j++)
    cout<<a[i][j];
    cout<<endl;
    }
    return 0;
    }
    ```

  • 1
    @ 2016-03-21 08:21:20

    测试数据 #0: Accepted, time = 0 ms, mem = 16916 KiB, score = 20

    测试数据 #1: Accepted, time = 0 ms, mem = 16920 KiB, score = 20

    测试数据 #2: Accepted, time = 0 ms, mem = 16916 KiB, score = 20

    测试数据 #3: Accepted, time = 0 ms, mem = 16920 KiB, score = 20

    测试数据 #4: Accepted, time = 0 ms, mem = 16916 KiB, score = 20

    Accepted, time = 0 ms, mem = 16920 KiB, score = 100

    秒过

  • 1
    @ 2015-08-21 12:45:36

    评测状态 Accepted
    题目 P1167 南蛮图腾
    递交时间 2015-08-21 12:44:27
    代码语言 C++
    评测机 Jtwd2
    消耗时间 11 ms
    消耗内存 16860 KiB
    评测时间 2015-08-21 12:44:28
    评测结果
    编译成功

    测试数据 #0: Accepted, time = 0 ms, mem = 16860 KiB, score = 20
    测试数据 #1: Accepted, time = 0 ms, mem = 16852 KiB, score = 20
    测试数据 #2: Accepted, time = 0 ms, mem = 16860 KiB, score = 20
    测试数据 #3: Accepted, time = 11 ms, mem = 16856 KiB, score = 20
    测试数据 #4: Accepted, time = 0 ms, mem = 16856 KiB, score = 20
    Accepted, time = 11 ms, mem = 16860 KiB, score = 100
    代码

    #include<cstdio>
    using namespace std;

    char a[1<<12][1<<12];
    int n,m;

    void fill(int i,int j,int k) {
    if (k!=1) {
    fill(i,j+(1<<k),k-1);
    fill(i-(1<<(k-1)),j+(1<<(k-1)),k-1);
    fill(i,j,k-1);
    }
    else {
    a[i][j]=a[i-1][j+1]='/';
    a[i][j+1]=a[i][j+2]='_';
    a[i][j+3]=a[i-1][j+2]='\';
    }
    }

    int main() {
    int k; scanf("%d",&k);
    n=(1<<k); m=(1<<(k+1));
    for (int i=1;i<=n;++i)
    for (int j=1;j<=m;++j)
    a[i][j]=' ';
    fill(n,1,k);
    for (int i=1;i<=n;++i){
    for (int j=1;j<=m;++j) {
    putchar(a[i][j]);
    }
    printf("\n");
    }
    return 0;
    }

  • 1
    @ 2014-03-21 14:51:57

    var i,j,n:longint;map:array[0..1024,0..2048]of char;a:array[0..11]of longint;
    procedure draw(x,y,n:longint);
    begin
    if n=1 then
    begin
    map[x,y]:='/';map[x,y+1]:='_';map[x,y+2]:='_';map[x,y+3]:='\';
    map[x+1,y+1]:='/';map[x+1,y+2]:='\';
    end
    else begin draw(x,y,n-1);draw(x+a[n-1],y+a[n-1],n-1);draw(x,y+a[n],n-1);end;
    end;
    begin
    for i:=1 to 1024 do
    for j:=1 to 2048 do
    map[i,j]:=' ';
    a[0]:=1;readln(n);
    for i:=1 to 11 do a[i]:=a[i-1]*2;
    draw(1,1,n);
    for i:=a[n] downto 1 do
    begin
    for j:=1 to a[n]+(a[n]-i+1) do write(map[i,j]);
    writeln;
    end;
    end.

  • 1
    @ 2014-01-14 21:06:34

    var s:array[1..3000] of ansistring;
    t:ansistring;
    n,q,i,l:longint;
    begin
    readln(n);
    s[1]:='/\';
    s[2]:='/__\';
    l:=4;
    for q:=2 to n do begin
    for i:=l shr 1+1 to l do
    s[i]:=s[i-l shr 1];
    t:='';
    for i:=1 to l-2 do t:=t+' ';
    for i:=l shr 1+1 to l do begin
    s[i]:=s[i]+t+s[i];
    delete(t,1,2);
    end;
    l:=l shl 1;
    end;
    t:='';
    l:=l shr 1;
    for i:=1 to l-1 do t:=t+' ';
    for i:=1 to l do begin
    writeln(t,s[i]);
    delete(t,1,1);
    end;
    end.
    27行

  • 0
    @ 2014-01-11 05:14:02

    #include<iostream>
    using namespace std;
    char a[1050][1050];
    void make(int n,int x,int y)
    {
    if(n==1)
    {
    a[x][y]=a[x-1][y+1]='/';
    a[x-1][y+2]=a[x][y+3]='\';
    a[x][y+1]=a[x][y+2]='_';
    return;
    }
    else
    {
    make(n-1,x-(1<<n-1),y+(1<<(n-1)));
    make(n-1,x,y);
    make(n-1,x,y+(1<<n));
    return;
    }
    }
    int main()
    {
    int n,i,j;
    cin>>n;
    make(n,(1<<n),1);
    for(i=1;i<=(1<<n);i++)
    {
    for(j=1;j<=i+(1<<n);j++)
    if(a[i][j])cout<<a[i][j];else cout<<' ';
    cout<<endl;
    }
    return 0;
    }

  • 0
    @ 2013-10-29 20:43:23

    下面那个打标的:给你n=8的 输出啊,不算太大96KB:看好了啊:
    /\
    /__\
    /\ /\
    /__\/__\
    /\ /\
    /__\ /__\
    /\ /\ /\ /\
    /__\/__\/__\/__\
    /\ /\
    /__\ /__\
    /\ /\ /\ /\
    /__\/__\ /__\/__\
    /\ /\ /\ /\
    /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\/__\/__\/__\/__\/__\/__\
    /\ /\
    /__\ /__\
    /\ /\ /\ /\
    /__\/__\ /__\/__\
    /\ /\ /\ /\
    /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\/__\/__\ /__\/__\/__\/__\
    /\ /\ /\ /\
    /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\ /__\/__\ /__\/__\ /__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\
    /\ /\
    /__\ /__\
    /\ /\ /\ /\
    /__\/__\ /__\/__\
    /\ /\ /\ /\
    /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\/__\/__\ /__\/__\/__\/__\
    /\ /\ /\ /\
    /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\ /__\/__\ /__\/__\ /__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\/__\/__\/__\/__\/__\/__\ /__\/__\/__\/__\/__\/__\/__\/__\
    /\ /\ /\ /\
    /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\ /__\/__\ /__\/__\ /__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\
    /\ /\
    /__\ /__\
    /\ /\ /\ /\
    /__\/__\ /__\/__\
    /\ /\ /\ /\
    /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\/__\/__\ /__\/__\/__\/__\
    /\ /\ /\ /\
    /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\ /__\/__\ /__\/__\ /__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\/__\/__\/__\/__\/__\/__\ /__\/__\/__\/__\/__\/__\/__\/__\
    /\ /\ /\ /\
    /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\ /__\/__\ /__\/__\ /__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\ /__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\
    /\ /\ /\ /\
    /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\ /__\/__\ /__\/__\ /__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\/__\/__\/__\/__\/__\/__\ /__\/__\/__\/__\/__\/__\/__\/__\ /__\/__\/__\/__\/__\/__\/__\/__\ /__\/__\/__\/__\/__\/__\/__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\
    /\ /\
    /__\ /__\
    /\ /\ /\ /\
    /__\/__\ /__\/__\
    /\ /\ /\ /\
    /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\/__\/__\ /__\/__\/__\/__\
    /\ /\ /\ /\
    /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\ /__\/__\ /__\/__\ /__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\/__\/__\/__\/__\/__\/__\ /__\/__\/__\/__\/__\/__\/__\/__\
    /\ /\ /\ /\
    /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\ /__\/__\ /__\/__\ /__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\ /__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\
    /\ /\ /\ /\
    /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\ /__\/__\ /__\/__\ /__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\/__\/__\/__\/__\/__\/__\ /__\/__\/__\/__\/__\/__\/__\/__\ /__\/__\/__\/__\/__\/__\/__\/__\ /__\/__\/__\/__\/__\/__\/__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\ /__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\
    /\ /\ /\ /\
    /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\ /__\/__\ /__\/__\ /__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\/__\/__\/__\/__\/__\/__\ /__\/__\/__\/__\/__\/__\/__\/__\ /__\/__\/__\/__\/__\/__\/__\/__\ /__\/__\/__\/__\/__\/__\/__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\ /__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\ /__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\ /__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\/__\/__\/__\/__\/__\/__\ /__\/__\/__\/__\/__\/__\/__\/__\ /__\/__\/__\/__\/__\/__\/__\/__\ /__\/__\/__\/__\/__\/__\/__\/__\ /__\/__\/__\/__\/__\/__\/__\/__\ /__\/__\/__\/__\/__\/__\/__\/__\ /__\/__\/__\/__\/__\/__\/__\/__\ /__\/__\/__\/__\/__\/__\/__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\ /__\/__\/__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\ /__\/__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\ /__\
    /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
    /__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\

  • 0
    @ 2013-08-10 18:13:22

    我用回溯AC了

    type
    fu1=0..9;
    var
    a:array[1..1024,1..2048]of char;
    i,j,maxx,maxy,x,y:integer;
    n:1..10;

    procedure tu(x,y:int64);
    begin
    a[x,y+1]:='/';
    a[x,y+2]:='\';
    a[x+1,y]:='/';
    a[x+1,y+1]:='_';
    a[x+1,y+2]:='_';
    a[x+1,y+3]:='\';
    end;

    procedure fu(f:fu1;x:int64;y:int64);
    var
    i,j,s:integer;
    b:boolean;
    begin
    if f=0 then exit;
    if f=1 then b:=true
    else b:=false;
    s:=1;
    for j:=1 to f do s:=s*2;
    for i:=1 to 3 do
    begin
    if i=1 then
    if b then tu(x,y)
    else fu(f-1,x,y);
    if i=2 then
    if b then tu(x+s,y-s)
    else fu(f-1,x+s,y-s);
    if i=3 then
    if b then tu(x+s,y+s)
    else fu(f-1,x+s,y+s);
    end;
    end;

    begin
    read(n);
    //assign(output,'out.out');rewrite(output);
    maxx:=2;
    maxy:=4;
    for i:=1 to n-1 do
    begin
    maxx:=maxx*2;
    maxy:=maxy*2;
    end;
    for i:=1 to maxx do
    for j:=1 to maxy do a[i,j]:=' ';
    x:=1;
    y:=(maxy div 2)-1;
    if n<>1 then fu(n-1,x,y)
    else tu(x,y);
    //writeln(maxx,' ',maxy);
    for i:=1 to maxx do
    begin
    for j:=1 to maxy do write(a[i,j]);
    writeln;
    end;
    //close(output);
    end.

  • 0
    @ 2012-09-24 20:03:57

    /w ~ 如果只递推半边三角形的话 递推写起来就方便多了 可惜输出的时候要稍作处理不然就会反来反去……

  • 0
    @ 2012-08-16 10:55:30

    编译通过...

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

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

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

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

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

    1ci

  • 0
    @ 2012-07-28 14:24:41

    超时了怎么办。。

  • 0
    @ 2010-07-24 21:13:45

    这种题可以理解难度为1...只要对递归有点熟悉,看到这么完美的三个三角形叠加重复出现,应该能写出递归方程。

    劲佩服n层楼下“木子日匀”的作品啊~~非递归能做得如此简洁,简直神了^__^!不过好像存在重复赋值的现象喔--fillchar完又在循环中重复赋入空格。

    制表的大牛们努力了!n=13时输出文件128MB,要拿100就只剩这最后一点了!

  • 0
    @ 2009-11-09 20:05:13

    /\

    /__\

    /\ /\

    /__\/__\

    /\ /\

    /__\ /__\

    /\ /\ /\ /\

    /__\/__\/__\/__\

    /\ /\

    /__\ /__\

    /\ /\ /\ /\

    /__\/__\ /__\/__\

    /\ /\ /\ /\

    /__\ /__\ /__\ /__\

    /\ /\ /\ /\ /\ /\ /\ /\

    /__\/__\/__\/__\/__\/__\/__\/__\

    美妙的图腾

    VIJOS 太没有美感了⊙﹏⊙b汗

  • 0
    @ 2009-10-24 11:55:48

    1

信息

ID
1167
难度
3
分类
模拟 点击显示
标签
递交数
1271
已通过
646
通过率
51%
被复制
9
上传者