$AcWing$

$Sol$

一年前做过差不多的南蛮图腾,当时做出来还是很有成就感的$OvO$

$N<=7$,就是模拟模拟,预处理一下,$over$

$Code$

#include<bits/stdc++.h>
#define il inline
#define Rg register
#define go(i,a,b) for(Rg int i=a;i<=b;++i)
#define yes(i,a,b) for(Rg int i=a;i>=b;--i)
#define mem(a,b) memset(a,b,sizeof(a))
#define ll long long
#define db double
using namespace std;
il int read()
{
Rg int x=,y=;char c=getchar();
while(c<''||c>''){if(c=='-')y=-;c=getchar();}
while(c>=''&&c<=''){x=(x<<)+(x<<)+c-'';c=getchar();}
return x*y;
}
char as[][][];
il int ksm(int x,int y){Rg int ret=;while(y){if(y&)ret*=x;x*=x;y>>=;}return ret;}
il void init()
{
as[][][]='X';
go(n,,)
{
Rg int qwq=ksm(,n-);
go(i,,qwq)
{
go(j,,qwq)as[n][i][j]=as[n][i][j+qwq*]=as[n-][i][j];
go(j,qwq+,*qwq)as[n][i][j]=' ';
}
go(i,qwq+,qwq*)
{
go(j,,qwq)as[n][i][j]=as[n][i][j+qwq*]=' ';
go(j,qwq+,*qwq)as[n][i][j]=as[n-][i-qwq][j-qwq];
}
go(i,qwq*+,qwq*)
{
go(j,,qwq)as[n][i][j]=as[n][i][j+qwq*]=as[n-][i-qwq*][j];
go(j,qwq+,*qwq)as[n][i][j]=' ';
}
}
}
int main()
{
init();
while()
{
Rg int n=read();if(n==-)break;
Rg int qwq=ksm(,n-);
go(i,,qwq){go(j,,qwq)printf("%c",as[n][i][j]);printf("\n");}
printf("-\n");
}
return ;
}

随机推荐

  1. Javascript用正则表达式replace替换父串中所有符合条件的子串

    这样用,只会替换匹配到的第一个子串 str = 'I hava a pen ,I hava an apple,apple pen, pen apple' str = str.replace('appl ...

  2. @codeforces - 1205D@ Almost All

    目录 @description@ @solution@ @accepted code@ @details@ @description@ 给定一个 n 个点的无向树. 请在每条边上写上权值,使得对于每一 ...

  3. @hdu - 5503@ EarthCup

    目录 @description@ @solution@ @accepted code@ @details@ @description@ n 个队伍两两之间比赛,保证没有平局. 现在给出 n 个队伍分别 ...

  4. ODT模板

    struct node{ int l,r; mutable int v; node(int L,int R,int V):l(L),r(R),v(V){} inline bool operator & ...

  5. hdu 1532 Drainage Ditches(最大流模板题)

    Drainage Ditches Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) ...

  6. 通过Ajax提交form表单来提交上传文件

    Ajax 提交form方式可以将form表单序列化 然后将数据通过data提交至后台,例如: $.ajax({      url : "http://localhost:8080/" ...

  7. 学习PHP好,还是Python好呢?

    首先简单介绍一下Python. Python在出现以来,已经有数以千计基于这项技术的网站和软件项目,Python因其独有的特点从众多开发语言中脱颖而出,深受世界各地的开发者喜爱. 下面,我们列举了Py ...

  8. hdu 3466 Proud Merchants(有排序的01背包)

    Proud Merchants Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/65536 K (Java/Others) ...

  9. Python--day47--内容回顾

    1.什么是数据库

  10. tensorflow -gpu安装,史上最新最简单的途径(不用自己装cuda,cdnn)

    tensorflow -gpu安装首先,安装Anoconda1. 官网下载点我: 2.安装 点击 python 3.6 version自动下载x64版,下载好之后,然后安装. 如图,打上勾之后,一路n ...