Pagini recente » Istoria paginii utilizator/topala.andrei | F. Robo | Jap2 | I. Vopsire | Diferente pentru problema/cntnk intre reviziile 1 si 2
Diferente pentru
problema/cntnk intre reviziile
#1 si
#2
Nu exista diferente intre titluri.
Diferente intre continut:
== include(page="template/taskheader" task_id="cntnk") ==
Poveste şi cerinţă...
Bemfa has a new drawing board, which is split into $N$ rows, each row contains $N$ cells. He has $K$ different colors and now he is wondering in how many ways can he color the given board in such a way that each cell is colored with exactly one color and no two neighboring cells have the same color.
Two cells are considered to be neighbors if they share one side.
Help Bemfa count how many ways mod $10^9 + 7$ are there to color the board given the above mentioned constraints.
h2. Date de intrare
Fişierul de intrare $cntnk.in$ ...
The first line of the input file $cntnk.in$ contains two integers, $N$ and $K$.
h2. Date de ieşire
În fişierul de ieşire $cntnk.out$ ...
The output file $cntnk.out$ will contain a single integer, representing the answer to the given test case.
h2. Restricţii
* $... ≤ ... ≤ ...$
* $1 ≤ N ≤ 8$
* $2 ≤ K ≤ 5$
h2. Exemplu
table(example). |_. cntnk.in |_. cntnk.out |
| This is some
text written on
multiple lines.
| This is another
text written on
multiple lines.
| 3 4
| 9612
|
h3. Explicaţie
...
== include(page="template/taskfooter" task_id="cntnk") ==
Nu exista diferente intre securitate.
Topicul de forum nu a fost schimbat.