Please subscribe to the official Codeforces channel in Telegram via the link: https://t.me/codeforces_official. ×

algorithms400's blog

By algorithms400, history, 10 months ago, In English,

How to find the numbers of ways to fill a grid (3*n)array, with three colors A, B and C.

Under the following constraints:

1) All the n cells of the same row can't have the same color.

2) All the 3 cells of the same column can't have the same color.

Sample input : if n=2, then output or number of ways = 174.

Please explain the approach for this.

 
 
 
 

»
10 months ago, # |
  Vote: I like it 0 Vote: I do not like it

This might help.