I've just learned about ordered set. I tried to use these templates
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> multi_ordered_set;
But I'm using Macbook, so I couldn't compile it. How can I fix that? Thanks for your help.








use GCC not Clang
I had tried to use gcc, but it didn't work
It will work, you need to compile with installed GCC path.
I followed the instructions at my own tutorial and I can use them on Mac just fine:
https://codeforces.me/blog/entry/136984
Minimal working example
Btw, take care when doing
using namespace __gnu_pbds;to avoid name clashing.I think there’s a bug in macOS 15.4. Before updating, PBDS was working fine on my Mac. If anyone’s got a fix, let us know!
Just run
brew install gcc@14and compile byg++-14 program.cpp [arguments]