Блог пользователя LGMyoshi

Автор LGMyoshi, история, 22 месяца назад, По-английски

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!

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

Автор LGMyoshi, история, 23 месяца назад, По-английски

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!

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1
  • Проголосовать: не нравится