C. Harmony Analysis
 

The semester is already ending, so Danil made an effort and decided to visit a lesson on harmony analysis to know how does the professor look like, at least. Danil was very bored on this lesson until the teacher gave the group a simple task: find 4 vectors in 4-dimensional space, such that every coordinate of every vector is 1 or  - 1 and any two vectors are orthogonal. Just as a reminder, two vectors in n-dimensional space are considered to be orthogonal if and only if their scalar product is equal to zero, that is:

.

Danil quickly managed to come up with the solution for this problem and the teacher noticed that the problem can be solved in a more general case for 2k vectors in 2k-dimensinoal space. When Danil came home, he quickly came up with the solution for this problem. Can you cope with it?

Input

The only line of the input contains a single integer k (0 ≤ k ≤ 9).

Output

Print 2k lines consisting of 2k characters each. The j-th character of the i-th line must be equal to ' * ' if the j-th coordinate of the i-th vector is equal to  - 1, and must be equal to ' + ' if it's equal to  + 1. It's guaranteed that the answer always exists.

If there are many correct answers, print any.

Sample test(s)
input
2
output
++**
+*+*
++++
+**+
Note

Consider all scalar products in example:

  • Vectors 1 and 2: ( + 1)·( + 1) + ( + 1)·( - 1) + ( - 1)·( + 1) + ( - 1)·( - 1) = 0
  • Vectors 1 and 3: ( + 1)·( + 1) + ( + 1)·( + 1) + ( - 1)·( + 1) + ( - 1)·( + 1) = 0
  • Vectors 1 and 4: ( + 1)·( + 1) + ( + 1)·( - 1) + ( - 1)·( - 1) + ( - 1)·( + 1) = 0
  • Vectors 2 and 3: ( + 1)·( + 1) + ( - 1)·( + 1) + ( + 1)·( + 1) + ( - 1)·( + 1) = 0
  • Vectors 2 and 4: ( + 1)·( + 1) + ( - 1)·( - 1) + ( + 1)·( - 1) + ( - 1)·( + 1) = 0
  • Vectors 3 and 4: ( + 1)·( + 1) + ( + 1)·( - 1) + ( + 1)·( - 1) + ( + 1)·( + 1) = 0

题意:给 k,构造2^k * 2^k的图,  使得任意两行 相乘相加值为0

题解:对于一个  满足了条件的 正方形,想要得到将其边长翻倍的图形  我们将它复制接右边,接到正下方,再取反接到斜对角,就是了;

    根据这个我们从1*1得到  2*2得到 4*4---到答案

//meek///#include<bits/stdc++.h>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include<iostream>
#include<bitset>
#include<vector>
#include <queue>
#include <map>
#include <set>
#include <stack>
using namespace std ;
#define mem(a) memset(a,0,sizeof(a))
#define pb push_back
#define fi first
#define se second
#define MP make_pair
typedef long long ll; const int N = ;
const int M = ;
const int inf = 0x3f3f3f3f;
const int MOD = ;
const double eps = 0.000001; int a[N][N],n;
int main() {
scanf("%d",&n);
a[][]=;
for(int x=;x<=n;x++) {
for(int i=;i<(<<x-);i++) {
for(int j=;j<(<<x-);j++) {
a[i][j+(<<x-)]=a[i][j];
a[i+(<<x-)][j]=a[i][j];
a[i+(<<x-)][j+(<<x-)]=-a[i][j];
}
}
}
for(int i=;i<(<<n);i++) {
for(int j=;j<(<<n);j++) {
if(a[i][j])printf("+");
else printf("*");
}
printf("\n");
}
return ;
}

代码

最新文章

  1. consul模板的说明2
  2. 选择题(codevs 2919)
  3. 恶趣味小游戏 I&#39;m hungry
  4. mongodb_查询操作使用_条件查询、where子句等(转)
  5. JS之mouseover和mouseenter
  6. unity,将camera设为don&#39;t clear在android上会显示不正常
  7. linux iostat命令详解 磁盘操作监控工具
  8. Android Studio中关于Project与Module
  9. log4net和一般的记录日志方法
  10. ES6模块之export和import详解
  11. hidden,display,visibility ,jQuery中的hide()区别
  12. 最简单的基于FFmpeg的AVDevice例子(屏幕录制)
  13. Python HTML解析器BeautifulSoup(爬虫解析器)
  14. jquery datatable数据初始化
  15. noi.openjudge 1.13.44
  16. 福大软工 &#183; BETA 版冲刺前准备(团队)
  17. Fiddler&#160;使用fiddler发送捕获的请求及模拟服务器返回
  18. BZOJ 1196: [HNOI2006]公路修建问题 Kruskal/二分
  19. 961 -尺寸2N阵列中的N重复元素
  20. 自动删除 Elasticsearch 索引

热门文章

  1. Java之HttpURLConnection的变态事: Keep-Alive
  2. Golang的Semicolons
  3. django-south
  4. Swift弹窗
  5. 为什么要用Message Queue
  6. 17.Quartus 怎么回读CPLD里面的东西
  7. 零基础学习Linux(一)环境搭建
  8. [2016-06-28]dhclient命令的进程没杀死,导致不断在向DHCP服务器获取IP
  9. 使用VBA实现Excel自杀功能
  10. ORA-12154:TNS:无法解析指定的连接标识符