305271: CF1001C. Generate GHZ state

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

C. Generate GHZ statetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

You are given N qubits (1 ≤ N ≤ 8) in zero state . Your task is to create Greenberger–Horne–Zeilinger (GHZ) state on them:

Note that for N = 1 and N = 2 GHZ state becomes states and 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:

namespace Solution {
open Microsoft.Quantum.Primitive;
open Microsoft.Quantum.Canon;

operation Solve (qs : Qubit[]) : ()
{
body
{
// your code here
}
}
}

Input

暂时还没有翻译

加入题单

算法标签: