We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Data Structures
- Advanced
- Library Query
- Discussions
Library Query
Library Query
Sort by
recency
|
19 Discussions
|
Please Login in order to post a comment
Thanks for this post Omaar bhai
It seems that C++ is fast enough for an O(Q(N+1000)) solution. Since the number of books is limited to 1000, counting sort is applicable. If the queried range was close to N each time, it would probably not pass the time limit (worst case ~10^8 operations), but it does pass for the given test cases.
time and space using a segment tree of
ordered_set
.Thanks for this post Google
Thanks for sharing thi s article. http://www.google.com/