A10086 | Harmony Analysis
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
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 $2^{k}$ vectors in $2^{k}$ -dimensinoal space. When Danil came home, he quickly came up with the solution for this problem. Can you cope with it?
.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 $2^{k}$ vectors in $2^{k}$ -dimensinoal space. When Danil came home, he quickly came up with the solution for this problem. Can you cope with it?
输入格式
The only line of the input contains a single integer $k$ ( $0<=k<=9$ ).
输出格式
Print $2^{k}$ lines consisting of $2^{k}$ 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.
If there are many correct answers, print any.
输入输出样例
输入 #1
2
输出 #1
++** +*+* ++++ +**+
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$
- 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$
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted