Hi everybody. I'm learning about SQRT decomposition and I want some problems. Can you give me? Thanks very much. ♥♦♣♠

# | User | Rating |
---|---|---|

1 | tourist | 3870 |

2 | Benq | 3618 |

3 | Miracle03 | 3453 |

4 | peehs_moorhsum | 3430 |

5 | Radewoosh | 3418 |

6 | Petr | 3408 |

7 | maroonrk | 3387 |

8 | sunset | 3338 |

9 | ko_osaga | 3334 |

9 | jiangly | 3334 |

# | User | Contrib. |
---|---|---|

1 | YouKn0wWho | 214 |

2 | 1-gon | 203 |

3 | Um_nik | 195 |

4 | Errichto | 181 |

5 | awoo | 180 |

6 | sus | 176 |

6 | tourist | 176 |

8 | antontrygubO_o | 173 |

9 | maroonrk | 170 |

10 | -is-this-fft- | 169 |

Hi everybody. I'm learning about SQRT decomposition and I want some problems. Can you give me? Thanks very much. ♥♦♣♠

↑

↓

Codeforces (c) Copyright 2010-2021 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Dec/06/2021 12:44:03 (i1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|

You can try to solve 3 problems below:

DQUERY

Sherlock and Inversions

Powerful array

Thank you very much!!!

Ummmm...

LINK

thanks very much!!!

This one has many solutions, but SQRT decomposition is one of them: 242E - XOR on Segment

If you're stuck, then here is the code: 24227961

szawinis can u explain the solution ..help would be appreciated!

You solve for each of the possible bits separately, then combine them later, since the query asks for sums. The reason why we do this is to make it more straightforward when applying the first query. This problem can also be solved using lazy segment tree which IMO is easier to code than SQRT decomp.

Thanks:)

This link might help you.

Here's another one that can be solved with SQRT decomposition http://codeforces.com/problemset/problem/13/E and with some SQRT heuristics this one too http://codeforces.com/contest/797/problem/E