PROBLEM DECORATION IN ByOI 2016

Revision en1, by coder_with_h, 2017-09-19 16:49:42

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?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English coder_with_h 2017-09-19 16:49:42 359 Initial revision (published)