---
id: LCT
title: "Link Cut Tree"
author: Benjamin Qi
description: "?"
prerequisites:
 - Advanced - Treaps
frequency: 1
---

import { Problem } from "../models";

export const metadata = {
  problems: {
    lctSam: [
      new Problem("YS", "Vertex Add Path Sum", "dynamic_tree_vertex_add_path_sum", "Normal", false, ["LCT"], ""),
    ],
    lct: [
      new Problem("SPOJ", "Dynamic Connectivity", "DYNACON1", "Intro", false, ["LCT"], "technically, LCT isn't needed because the queries are offline"),
      new Problem("CF", "Silence's Sounds", "contest/1109/problem/F", "Easy", false, ["LCT"], "test connectivity"),
      new Problem("YS", "Vertex Add Path Composite", "dynamic_tree_vertex_set_path_composite", "Normal", false, ["LCT"], ""),
      new Problem("SPOJ", "Dynamic LCA", "DYNALCA", "Normal", false, ["LCT"], ""),
      new Problem("DMOJ", "Squirrel Cities", "wac4p7", "Normal", false, ["LCT"], "link, cut, min edge along path"),
      new Problem("HR", "Balanced Tokens", "https://www.hackerrank.com/contests/pwshpc-online-round/challenges/pwsh-tokens/problem", "Normal", false, ["LCT"], ""),
      new Problem("CSES", "CEOI - Treasure Hunt", "https://cses.fi/174/list/", "Normal", false, ["LCT"], ""),
      new Problem("DMOJ", "Dynamic Tree Test (Easy)", "ds5easy", "Hard", false, ["LCT"], ""),
      new Problem("CF", "Train Tracking", "contest/1344/problem/E", "Hard", false, ["LCT"], "* switching can be done with LCT access, set min on path with lazy prop  * [Solution](https://codeforces.com/contest/1344/submission/79212522)"),
      new Problem("CF", "Tree or not Tree", "contest/117/problem/E", "Hard", false, ["LCT"], "tree + one edge"),
      new Problem("CF", "CERC 17 D", "gym/101620", "Hard", false, ["LCT"], "LCT not needed, but can directly apply solution from The Applicant"),
      new Problem("ojuz", "IOI - Dancing Elephants", "IOI11_elephants", "Hard", false, [], ""),
    ],
    subSam: [
      new Problem("YS", "Vertex Add Subtree Sum", "dynamic_tree_vertex_add_subtree_sum", "Normal", false, ["LCT"], ""),
    ],
    sub: [
      new Problem("CF", "Pastoral Oddities", "contest/603/problem/E", "Normal", false, ["LCT"], ""),
      new Problem("YS", "Subtree Add Subtree Sum", "dynamic_tree_subtree_add_subtree_sum", "Hard", false, ["LCT"], ""),
      new Problem("CF", "Old Driver Tree", "contest/1172/problem/E", "Hard", false, ["LCT"], ""),
      new Problem("DMOJ", "Dynamic Tree Test", "ds5", "Very Hard", false, ["LCT"], ""),
    ]
  }
};

## Splay Tree

### Tutorial

  - [Splay Tree Paper](https://www.cs.cmu.edu/~sleator/papers/self-adjusting.pdf)
  - [Stanford Presentation](https://web.stanford.edu/class/archive/cs/cs166/cs166.1146/lectures/08/Slides08.pdf)

(Implementation?)

  - [Euler Tour Tree](https://codeforces.com/blog/entry/18369)
  
## Link Cut Tree - Paths

<problems-list problems={metadata.problems.lctSam} />

### Tutorial

  - [MIT](http://courses.csail.mit.edu/6.851/spring12/scribe/L19.pdf)
  - [CTSC 2014 Translation](https://www.overleaf.com/read/zbbwngftkrkx?fbclid=IwAR1VJmGscfSZJHejVqU5_2Nlm8-R09pFlU7PpEg_i3CXEd0Qw-dzliSn5RI)


(Implementation?)

### Problems

<problems-list problems={metadata.problems.lct} />

### USACO Camp

(Maybe add descriptions since problems not publicly viewable.)

  * [The Applicant](https://probgate.org/viewproblem.php?pid=578)
    * tree + one edge
  * [Cows Play on a Tree](https://probgate.org/viewproblem.php?pid=259)
    * reverse tree paths
    * HLD + Treap
    * or two LCTs, one for real tree labels and one for query labels

## Link Cut Tree - Subtrees

<problems-list problems={metadata.problems.subSam} />

### Tutorial

  - [CF](https://codeforces.com/blog/entry/67637)

### Problems

<problems-list problems={metadata.problems.sub} />
