We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Project Euler #189: Tri-colouring a triangular grid
Project Euler #189: Tri-colouring a triangular grid
Sort by
recency
|
10 Discussions
|
Please Login in order to post a comment
This can be solved by using chromatic polynomials and using deletion contraction algorithm. Memoization is necessary as we count polynomial for the same graph many times. In order it to work I had to represent graph in a very consice way as string is used as a key to cache and must as short as possible. By no means this is an easy task. Should be at least marked as hard.
It looks like the main issue here is to account of symmetry
Pls some1 tell me what is modulo 10^9+7 I
For this, if we're given 3 colors, are we allowed to use any 3! color choices? I.e. if we're given three colors, can we include just one, two of the three, and all three, or does it just need to be all three colors?
Why do I get wrong answer for some test cases while others are correct?