P1417 [CF1001C] Generate GHZ state
普及
题目描述

You are given N qubits (1 ≤ N ≤ 8) in zero state $${\left|0\dots0\right\rangle}$$. Your task is to create Greenberger–Horne–Zeilinger (GHZ) state on them:

$${ \left| GHZ \right\rangle } = { \frac { 1 } { \sqrt { 2 } } } ( { \left| 0 \dots 0 \right\rangle } + { \left| 1 \dots 1 \right\rangle } )$$

Note that for N = 1 and N = 2 GHZ state becomes states $$|+\rangle$$ and $$| B_{0} \rangle$$ from the previous tasks, respectively.

Input

You have to implement an operation which takes an array of N qubits as an input and has no output. The "output" of your solution is the state in which it left the input qubits.

Your code should have the following signature:

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
1 232343
样例输出
Test passed