How to approach this problem.

Revision en1, by aloo_parantha, 2020-12-03 08:34:13

Problem Link : https://www.codechef.com/ENFE2020/problems/ECFEB207

I think, we can decide some colours which are to be arranged in the first column, and then each of the selected colour should be present in the last column at least once in any order , and the rest of the (N) X (N-2) matrix can have any distribution with these selected colours, because now,no matter wherever we draw a vertical line , number of distinct colours in the two parts will be same…I couldn’t implement it. Can anyone please let me know, if this approach is correct and how can I implement it. Or suggest some better approach…

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English aloo_parantha 2020-12-03 17:10:10 674
en1 English aloo_parantha 2020-12-03 08:34:13 640 Initial revision (published)