---
id: sqrt
title: "Square Root Decomposition"
author: Benjamin Qi
description: "?"
frequency: 1
prerequisites:
 - 
---
import { Problem } from "../models";

export const metadata = {
  problems: {
    fst: [
      new Problem("CF", "Tree Queries", "contest/1254/problem/D", "Hard", false, [], ""),
      new Problem("wcipeg", "COI 08-Otoci", "https://wcipeg.com/problem/coi08p2", "Hard", false, ["HLD"], "Editorial rebuilds HLD after certain # of updates ..."),
      new Problem("Old Gold", "Fencing the Herd", "534", "Very Hard", false, ["Convex hull"], ""),
      new Problem("DMOJ", "Fluid Dynamics", "dmopc19c7p7", "Very Hard", false, [], ""),
      new Problem("Plat", "At Large", "793", "Very Hard", false, [], ""),
    ],
    block: [
      new Problem("DMOJ", "Arithmetic Subtrees", "wac1p7", "Very Hard", false, [], ""),
    ],
    other: [
      new Problem("Plat", "Train Tracking", "841", "Insane", false, [], ""),
    ]
  }
};

## On Line

processing sqrt queries / updates at a time

partitioning into sqrt blocks (each block can have some sort of data structure ...)

optimization tips? (ez to get TLE with bad constant ..., can get AC with suboptimal complexity ...)

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

## Mo's

<resources>
  <resource source="CF" title="Mo's Algorithm" url="blog/entry/7383"></resource>
  <resource source="CF" title="Mo's on Trees" url="blog/entry/43230"></resource>
</resources>

[A2OJ](https://a2oj.com/category?ID=318)

## Other

### Block Tree

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

<resources>
  <resource source="CF" title="Block Tree" url="blog/entry/46843"></resource>
</resources>

### Train Tracking

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