Tima3's blog

By Tima3, 15 months ago, In English

Hello codeforces

Recently I met with several tasks (in my head) and could not come up with a solution.

1 Given a graph consisting of undirected weighted edges. There are two types of queries, add an edge to a graph. Find the shortest path between two vertices.

As I understand it, if it were said that a lot of trees were given, the task would be solved using DSU or Link-cut tree, but with graphs it becomes much more difficult, and the question is whether there is something better than running Dijkstra for every request of the second type.

2 Given a directed graph and queries of 2 types. 1 — add a directed edge to the graph 2 — tell if there is a path between two vertices

Full text and comments »

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

By Tima3, history, 18 months ago, translation, In English

Hello codeforces!

I recently came across the topic of dp optimization (Knuta-Yao, Lambda, Convex Hull Trick, divide and conquer), and it seemed to me that it often appeared at the olympiads in my region. However, I practically did not find a task on this topic (I do not deny the fact that I searched badly). So, if someone has links to problems on this topic or search method for such problems and you don't mind sharing them, I will be very grateful to you!

Full text and comments »

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