알고리즘 문제 시켜봣는데
존나 열심히 코드짬 커여워 ㅋㅋ
We have a tree of N vertices (a connected graph with no undirected cycles). Vertices are numbered 1 through N, and edges are numbered 1 through N-1.
Write a program that performs the two queries below.
1 i c: Change the cost of edge i to c.
2 u v: Outputs the largest cost among the simple paths from u to v.
Here is a possible solution using a data structure called a Fenwick tree, also known as a binary indexed tree, to perform the two queries efficiently:
학대를 멈춰주세요.. - dc App
착실한놈이야 ㅋ
커엽