Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

Same Color — Help!

Правка en1, от vishal_sahu, 2023-07-01 17:08:41

Given a weighted tree consisting of N vertices and N-1 edges. In a single operation, you can select an edge and increase or decrease its weight by 1. You are given Q queries and a query consisting of two vertices U and V, determine the minimum number of operations to be performed such that the weight of each edge of the path from vertex U to vertex V becomes the same.

With constraint up to 10^5;

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский vishal_sahu 2023-07-01 17:08:41 424 Initial revision (published)