1001C.md (1257B)
1 Source: https://codeforces.com/problemset/problem/1001/C 2 3 C. Generate GHZ state 4 5 time limit per test 6 7 1 second 8 9 memory limit per test 10 11 256 megabytes 12 13 input 14 15 standard input 16 17 output 18 19 standard output 20 21 You are given *N* qubits (1 ≤ *N* ≤ 8) in zero state . Your task is to create Greenberger–Horne–Zeilinger (GHZ) state on them: 22 23  24 25 Note that for *N* = 1 and *N* = 2 GHZ state becomes states  and  from the previous tasks, respectively. 26 27 Input 28 29 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. 30 31 Your code should have the following signature: 32 33 ``` 34 namespace Solution { 35 open Microsoft.Quantum.Primitive; 36 open Microsoft.Quantum.Canon; 37 38 operation Solve (qs : Qubit[]) : () 39 { 40 body 41 { 42 // your code here 43 } 44 } 45 } 46 ```