Только перечисленные языки могут быть использованы для решения задач соревнования
Microsoft Q# Coding Contest - Summer 2020 - Warmup:
Microsoft Q#
→ Виртуальное участие
Виртуальное соревнование – это способ прорешать прошедшее соревнование в режиме, максимально близком к участию во время его проведения. Поддерживается только ICPC режим для виртуальных соревнований.
Если вы раньше видели эти задачи,
виртуальное соревнование не для вас – решайте эти задачи в архиве.
Если вы хотите просто дорешать задачи, виртуальное соревнование не для вас – решайте эти задачи в архиве.
Запрещается использовать чужой код, читать разборы задач и общаться по содержанию соревнования с кем-либо.
You are given an operation that implements a single-qubit unitary transformation: either the identity (I gate) or the X gate. The operation will have Adjoint and Controlled variants defined.
Your task is to perform necessary operations and measurements to figure out which unitary it was and to return 0 if it was the I gate or 1 if it was the X gate.
You are allowed to apply the given operation and its adjoint/controlled variants exactly once.
You have to implement an operation which takes a single-qubit operation as an input and returns an integer. Your code should have the following signature:
namespace Solution { open Microsoft.Quantum.Intrinsic;
operation Solve (unitary : (Qubit => Unit is Adj+Ctl)) : Int { // your code here } }