305272: CF1001D. Distinguish plus state and minus state

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

Description

D. Distinguish plus state and minus statetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

You are given a qubit which is guaranteed to be either in or in state.

Your task is to perform necessary operations and measurements to figure out which state it was and to return 1 if it was a state or -1 if it was state. The state of the qubit after the operations does not matter.

Input

You have to implement an operation which takes a qubit as an input and returns an integer.

Your code should have the following signature:

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

operation Solve (q : Qubit) : Int
{
body
{
// your code here
}
}
}

Input

暂时还没有翻译

加入题单

算法标签: