Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add chapter Segment Tree Beats #34

Open
chihhsi opened this issue Apr 10, 2023 · 4 comments · May be fixed by #90
Open

Add chapter Segment Tree Beats #34

chihhsi opened this issue Apr 10, 2023 · 4 comments · May be fixed by #90
Assignees
Labels
proposal Proposal for new content

Comments

@chihhsi
Copy link

chihhsi commented Apr 10, 2023

Introduction to Segment Tree Beats

  • Construct tree node (sum, max1, max2, maxc, min1, min2, minc, lazy tag)
  • Construct tree (build)
  • Range modification
    • update_add / push_add
    • update_max / push_max
    • update_min / push_min
    • push_down
  • Merge functions
  • Range query
@chihhsi
Copy link
Author

chihhsi commented Apr 10, 2023

Basic Segment Tree Beats Problems

  • RMQ
  • For all i in [l, r], change $A_i$ to x
  • For all i in [l, r], change $A_i$ to $A_i$+x
  • For all i in [l, r], change $A_i$ to max($A_i$-x, 0)
  • Codeforces 438D The Child and Sequence

@chihhsi
Copy link
Author

chihhsi commented Apr 10, 2023

Advanced Segment Tree Beats Problems

  • Codeforces 1290E Cartesian Tree : For each k in the range [1, n], construct a Cartesian tree using the k smallest values, and find the sum of sizes of all the subtrees in the tree.
  • Codeforces 1572F Stations : The i-th city can broadcast to j-th if for all k in [i, j], max{ $h_k$ } < $h_i$
  • Given n operations, each providing (l, r, h), place a rectangle with height h on the x-axis between l and r. Find the total perimeter of the resulting shape after each operation.

@harry900831
Copy link
Contributor

@chihhsi Missing references

@harry900831 harry900831 added the proposal Proposal for new content label May 8, 2023
@harry900831 harry900831 linked a pull request May 18, 2023 that will close this issue
8 tasks
@harry900831 harry900831 linked a pull request Jun 27, 2023 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Proposal for new content
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants