Solution (source code)

= Solution
{c}

Each of the $n$ distinct elements can receive any of the $x$ labelled colours. The <multiplication principle> therefore gives
$$
\boxed{x^n}
$$
colour assignments; colours are allowed to remain unused.