The following languages are only available languages for the problems from the contest

Microsoft Q# Coding Contest - Summer 2018:

- Microsoft Q#

Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ACM-ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

No tag edit access

D2. Oracle for f(x) = b * x + (1 - b) * (1 - x) mod 2

time limit per test

1 secondmemory limit per test

256 megabytesinput

standard inputoutput

standard outputImplement a quantum oracle on *N* qubits which implements the following function:

Here (a vector of *N* integers, each of which can be 0 or 1), and is a vector of *N* 1s.

For an explanation on how this type of quantum oracles works, see Introduction to quantum oracles.

You have to implement an operation which takes the following inputs:

- an array of
*N*qubits*x*in arbitrary state (input register), 1 ≤*N*≤ 8, - a qubit
*y*in arbitrary state (output qubit), - an array of
*N*integers*b*, representing the vector . Each element of*b*will be 0 or 1.

The operation doesn't have an output; its "output" is the state in which it leaves the qubits.

Your code should have the following signature:

namespace Solution {

open Microsoft.Quantum.Primitive;

open Microsoft.Quantum.Canon;

operation Solve (x : Qubit[], y : Qubit, b : Int[]) : ()

{

body

{

// your code here

}

}

}

Codeforces (c) Copyright 2010-2018 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Nov/17/2018 12:58:41 (d1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|