coder_with_h's blog

By coder_with_h, history, 3 years ago, In English,

Given a graph with N nodes and M edges. Each node is painted in one of N colors initially. There are Q queries of the following form: Repaint a single node to the given color. After performing each query, output the number of edges having both endpoints of the same color.

Can anyone please help me solve this problem?

Read more »

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