Hi everyone,
I am trying to solve the problem here :
https://codeforces.me/contest/1758/problem/E
This is an editorial for the problem : https://codeforces.me/blog/entry/109438
I am having few doubts after reading the editorial. Can someone help out ?
My doubts :
Using these relationships, we can create a weighted directed graph using our rows as nodes.
What is direction of the edge in graph ? What should be the weight of the edge ?
Obviously, no solutions exist if there are discrepancies in the graph (modℎ), no solution exists.
What is meaning of discrepancies in the graph
?
Now, for each connected component, if there is an assigned value in one of the rows it contains, we can determine all of the other values for that column in the connected component.
How can we have connected components in the directed graph ? Are there all nodes reachable from all the other nodes in the component ?
Can someone help me clear doubts so I can upsolve ?