{"problem":{"name":"A1. Generate superposition of all basis states","description":{"content":"You are given _N_ qubits (1 ≤ _N_ ≤ 8) in zero state . Your task is to generate an equal superposition of all 2_N_ basis vectors on _N_ qubits: For example, *   for _N_ = 1, the required state is s","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF1002A1"},"statements":[{"statement_type":"Markdown","content":"You are given _N_ qubits (1 ≤ _N_ ≤ 8) in zero state .\n\nYour task is to generate an equal superposition of all 2_N_ basis vectors on _N_ qubits:\n\nFor example,\n\n*   for _N_ = 1, the required state is simply ,\n*   for _N_ = 2, the required state is .\n\nYou have to implement an operation which takes an array of _N_ qubits as an input and has no output. The \"output\" of the operation is the state in which it leaves the qubits.\n\nYour code should have the following signature:\n\nnamespace Solution {\n    open Microsoft.Quantum.Primitive;\n    open Microsoft.Quantum.Canon;\n\n    operation Solve (qs : Qubit\\[\\]) : ()\n    {\n        body\n        {\n            // your code here\n        }\n    }\n}\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"给定 #cf_span[N] 个量子比特（#cf_span[1 ≤ N ≤ 8]），初始处于零态。\n\n你的任务是生成在 #cf_span[N] 个量子比特上所有 #cf_span[2N] 个基矢的等权叠加态：\n\n例如，\n\n你需要实现一个操作，该操作以一个包含 #cf_span[N] 个量子比特的数组作为输入，且无输出。该操作的“输出”是其作用后量子比特所处的状态。\n\n你的代码应具有如下签名：\n\n[samples]","is_translate":true,"language":"Chinese"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ N \\in \\mathbb{Z} $ with $ 1 \\leq N \\leq 8 $.  \nLet $ \\mathcal{H} = (\\mathbb{C}^2)^{\\otimes N} $ be the Hilbert space of $ N $ qubits.  \nLet $ \\{|x\\rangle \\mid x \\in \\{0,1\\}^N\\} $ be the computational basis of $ \\mathcal{H} $, with $ |x\\rangle $ denoting the computational basis state corresponding to bitstring $ x $.\n\n**Constraints**  \nThe initial state of the system is $ |0\\rangle^{\\otimes N} $.\n\n**Objective**  \nImplement a unitary operation $ U $ such that:  \n$$\nU |0\\rangle^{\\otimes N} = \\frac{1}{\\sqrt{2^N}} \\sum_{x \\in \\{0,1\\}^N} |x\\rangle\n$$  \nThe operation $ U $ acts on $ N $ qubits and has no classical output; the result is the final quantum state of the qubits.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF1002A1","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}