codeforces-scrape

Codeforces scraped problems and editorials
git clone git://git.laack.co/codeforces-scrape.git
Log | Files | Refs | README

1001E.md (1405B)


      1 Source: https://codeforces.com/problemset/problem/1001/E
      2 
      3 E. Distinguish Bell states
      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 two qubits which are guaranteed to be in one of the Bell states:
     22 
     23 * ![](https://espresso.codeforces.com/3bd300187bec68a260f07bb41226aad198f9aef0.png)
     24 * ![](https://espresso.codeforces.com/2b05513e9a357b2122b3d30583a71885a247a3b8.png)
     25 * ![](https://espresso.codeforces.com/8c3b892f53b8bf7ed84f55a5087ada2ab50dd4d1.png)
     26 * ![](https://espresso.codeforces.com/d094280f4b9897c9aec5e2ba5e920d00e37656fc.png)
     27 
     28 Your 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 ![](https://espresso.codeforces.com/aec27febc80bfeb882cb96d33386f048ce011703.png), 1 for ![](https://espresso.codeforces.com/4c7fe2c174363ceb367b7686e92c7fb9a36da8bf.png) etc.). The state of the qubits after the operations does not matter.
     29 
     30 Input
     31 
     32 You have to implement an operation which takes an array of two qubits as an input and returns an integer.
     33 
     34 Your code should have the following signature:
     35 
     36 ```
     37 namespace Solution {  
     38     open Microsoft.Quantum.Primitive;  
     39     open Microsoft.Quantum.Canon;  
     40   
     41     operation Solve (qs : Qubit[]) : Int  
     42     {  
     43         body  
     44         {  
     45             // your code here  
     46         }  
     47     }  
     48 }
     49 ```