305269: CF1001A. Generate plus state or minus state
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
A. Generate plus state or minus statetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output
You are given a qubit in state and an integer sign.
Your task is to convert the given qubit to state if sign = 1 or if sign = - 1.
InputYou have to implement an operation which takes a qubit and an integer as an input and has no output. The "output" of your solution is the state in which it left the input qubit.
Your code should have the following signature:
namespace Solution {
open Microsoft.Quantum.Primitive;
open Microsoft.Quantum.Canon;
operation Solve (q : Qubit, sign : Int) : ()
{
body
{
// your code here
}
}
}
Input
暂时还没有翻译