{"problem":{"name":"E. Distinguish Bell states","description":{"content":"You are given two qubits which are guaranteed to be in one of the Bell states: Your task is to perform necessary operations and measurements to figure out which state it was and to return the index o","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF1001E"},"statements":[{"statement_type":"Markdown","content":"You are given two qubits which are guaranteed to be in one of the Bell states:\n\nYour task is to perform necessary operations and measurements to figure out which state it was and to return the index of that state (0 for , 1 for etc.). The state of the qubits after the operations does not matter.\n\n## Input\n\nYou have to implement an operation which takes an array of two qubits as an input and returns an integer.\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\\[\\]) : Int\n    {\n        body\n        {\n            // your code here\n        }\n    }\n}\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"你被给予两个量子比特，它们保证处于贝尔态之一：\n\n你的任务是执行必要的操作和测量，以确定它是哪个态，并返回该态的索引（0 表示 ，1 表示 ，依此类推）。操作后量子比特的状态无关紧要。\n\n你需要实现一个操作，该操作接受一个包含两个量子比特的数组作为输入，并返回一个整数。\n\n你的代码应具有以下签名：\n\n## Input\n\n你需要实现一个操作，该操作接受一个包含两个量子比特的数组作为输入，并返回一个整数。你的代码应具有以下签名：namespace Solution {    open Microsoft.Quantum.Primitive;    open Microsoft.Quantum.Canon;    operation Solve (qs : Qubit[]) : Int    {        body        {            // your code here        }    }}\n\n[samples]","is_translate":true,"language":"Chinese"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ \\mathcal{H} = \\mathbb{C}^2 \\otimes \\mathbb{C}^2 $ be the Hilbert space of two qubits.  \nLet $ \\{ |\\Phi^+\\rangle, |\\Phi^-\\rangle, |\\Psi^+\\rangle, |\\Psi^-\\rangle \\} $ be the Bell basis, defined as:  \n$$\n\\begin{aligned}\n|\\Phi^+\\rangle &= \\frac{1}{\\sqrt{2}}(|00\\rangle + |11\\rangle), \\\\\n|\\Phi^-\\rangle &= \\frac{1}{\\sqrt{2}}(|00\\rangle - |11\\rangle), \\\\\n|\\Psi^+\\rangle &= \\frac{1}{\\sqrt{2}}(|01\\rangle + |10\\rangle), \\\\\n|\\Psi^-\\rangle &= \\frac{1}{\\sqrt{2}}(|01\\rangle - |10\\rangle).\n\\end{aligned}\n$$  \nThe input state $ |\\psi\\rangle \\in \\mathcal{H} $ is guaranteed to be one of these four Bell states.\n\n**Objective**  \nGiven $ |\\psi\\rangle \\in \\{ |\\Phi^+\\rangle, |\\Phi^-\\rangle, |\\Psi^+\\rangle, |\\Psi^-\\rangle \\} $, determine $ i \\in \\{0,1,2,3\\} $ such that:  \n$$\n|\\psi\\rangle = \n\\begin{cases}\n|\\Phi^+\\rangle & \\text{if } i = 0, \\\\\n|\\Phi^-\\rangle & \\text{if } i = 1, \\\\\n|\\Psi^+\\rangle & \\text{if } i = 2, \\\\\n|\\Psi^-\\rangle & \\text{if } i = 3.\n\\end{cases}\n$$  \nThis is to be done via quantum operations and measurements, returning the index $ i $.\n\n**Constraints**  \n- The operation must act on a two-qubit system in one of the four Bell states.  \n- Only unitary operations and projective measurements in the computational basis are permitted.  \n- The final state of the qubits after measurement is irrelevant.  \n- The output must be an integer $ i \\in \\{0,1,2,3\\} $ corresponding to the identified Bell state.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF1001E","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}