3 ms·
https://en.wikipedia.org/wiki/Segment_tree https://en.wikipedia.org/wiki/Segment_tree
by ctoth 14y ago
https://en.wikipedia.org/wiki/Segment_tree https://en.wikipedia.org/wiki/Segment_tree
- shadykiller 14y agoThis looks cool . .my implementation also stores counts .. and is more optimized for storing counts(intersections) than ranges Quoting from the wiki page: If Int(T) is contained in X then store X at T, and finish. For the same case I split the current node into 3 intervals