wannared's blog

By wannared, history, 7 years ago, In English

Can someone help me solving this problem Link problem statement is very simple

  • Vote: I like it
  • +7
  • Vote: I do not like it

| Write comment?
»
7 years ago, # |
  Vote: I like it +3 Vote: I do not like it

I think we need to make DAG with weights of edges 0/1. If u->v has weight 0 it means that a[v] >= a[u] + 0 and if u->v has weight 1 a[v] > a[i] (<=> a[v] >= a[u] + 1). If we have this graph it is easy to build the initial matrix. But i don't know how to build it and how to find out if there are no such graphs, so i also want to read the solution.