LGMyoshi's blog

By LGMyoshi, history, 22 months ago, In English

Hi CF!

I'm using using c++ on my mac on CLion and I'm trying to import the following:

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

It just says "'ext/pb_ds/tree_policy.hpp' file not found". How do I fix this?

Much appreciated!

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By LGMyoshi, history, 22 months ago, In English

Hi all!

I had a question about a commonly known trick for this problem: — Given a set of points(x and y are between 0 and 1e5), calculate the total number of pairs of points that are within a Manhattan distance of 'k'.

I know that you can use a BIT with a sweepline by changing each point to (x + y, x — y). My question is: How does 'k' change when I do the grid rotation / how do I perform queries after the grid rotation?

Thank you in advance!

Full text and comments »

  • Vote: I like it
  • +1
  • Vote: I do not like it