When submitting a solution in C++, please select either C++14 (GCC 6-32) or C++17 (GCC 7-32) as your compiler. ×

CP_Sucks's blog

By CP_Sucks, history, 5 years ago, In English

If any like me get this error while importing the Pbds in #includes..

I got error importing this -> #include<ext/pb_ds/assoc_container.hpp> Error was "cannot open source file hash_standard_resize_policy_imp.hpp ".

Fix go to the dir -> C:\MinGW\lib\gcc\mingw32\8.2.0\include\c++\ext\pb_ds\detail\resize_policy

There u will see a file similar to -> "hash_standard_resize_policy_imp.hpp0000644"

Rename it to hash_standard_resize_policy_imp.hpp

and now it worked for me .

I don't know the real reason why the file was weirdly name before if someone knows plz comment down below and tell.

Hope this helps.

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

| Write comment?
»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Worked for me.

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Thanks, worked for me...

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

You are a life saver!!!Worked for windows 10..

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

I had been avoiding the hassle of trying to get pbds to work, but it seems like it's this simple! Yay!

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Thank you !! Thank you !! Inthakanna em cheppagalam..

  • »
    »
    4 years ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    Is this Tamil? Or maybe it's Telugu (looks similar but I can't understand it lol).

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Yes it is certainly weird given the fact that they didn't rectified this error for i don't know how long , seems like every version of gcc comes with file like this, or maybe it's not an error at all :|

»
4 years ago, # |
  Vote: I like it -6 Vote: I do not like it

Probably the most useful post i've read in a while on codeforces!

Thank you, now i don't have to use the custom invocation tab whenever i use pb_ds.

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Thankyou so much

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Thanks , It really helped

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Worked for me too ... really saved my time !!

»
2 years ago, # |
  Vote: I like it +5 Vote: I do not like it

Worked for me too! Thanks! IDK what's holding the provider from fixing this. Gave me a headache for almost half an hour...until I came across THIS magical post :D

»
17 months ago, # |
  Vote: I like it 0 Vote: I do not like it

It is not working in windows 10. Is there any other solution for this.

  • »
    »
    17 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    it is working for me (i m also using windows 10).

    Can u pls share your error ss?

  • »
    »
    17 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    It was not working for me too. Then I installed the latest gcc version.

    • »
      »
      »
      17 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Can you share how can i install latest gcc version. In my case gcc version is 6.3 .

      • »
        »
        »
        »
        17 months ago, # ^ |
        Rev. 2   Vote: I like it 0 Vote: I do not like it

        .

        • »
          »
          »
          »
          »
          17 months ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          This not the latest version. gcc 12.2 is the latest. I currently have 11.2.0. Just google how to install ... You'll find the steps.

          • »
            »
            »
            »
            »
            »
            17 months ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            oh sorry mine was 6.3 and it worked fine so i got confused.

»
17 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Hey, Can anyone clear my doubt please. If I use my pbds as a mutliset and I want to find the number of elements which are smaller than than any element, is it possible to solve this using pbds?

  • »
    »
    17 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    yes, it is possible you can do that.

    • »
      »
      »
      17 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I tried it order of key but it gives me the total number of distinct elements less than a element but I want to find the total number of elements smaller than my number. For example, in the pbds with elements 1 2 2 2 4, If I use order of key for element 4, it will give an output of 2 but I want to find a way so that the output would be 4.

      • »
        »
        »
        »
        17 months ago, # ^ |
        Rev. 3   Vote: I like it 0 Vote: I do not like it

        for set:- #define order_set tree<int, null_type,less, rb_tree_tag,tree_order_statistics_node_update>

        for multiset:- #define order_set tree<int, null_type,less_equal, rb_tree_tag,tree_order_statistics_node_update>

        you have to use less_equal instead of less in syntax to make it work as a multiset. order_of_key will give correct in the second case

»
3 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Thanks it worked for me

»
3 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Thanks, Worked for me :)

»
3 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Thanks brother, it works.

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

it's worked for me thankyou

»
7 days ago, # |
  Vote: I like it 0 Vote: I do not like it

worked for me :)