Codeforces Round 1133 (Div. 1, Div. 2) is coming soon! Register here. ×

enesoncu's blog

By enesoncu, 12 years ago, In English

How can I find least one bit in bitset? I can't use A&-A where A is bitset.

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

»
12 years ago, hide # |
← Rev. 2  
Vote: I like it +49 Vote: I do not like it

For C++

bitset<200> b;
b[33] = true;
cout << b._Find_first() << endl;
  • »
    »
    12 years ago, hide # ^ |
     
    Vote: I like it +8 Vote: I do not like it

    Thank you very much. How can I reach info about this kind a functions? I searched web but I couldn't find information.

  • »
    »
    12 years ago, hide # ^ |
     
    Vote: I like it +16 Vote: I do not like it

    I'd say it's for g++, not for c++.

    (It's not standard c++ and is not supported in MSVC (cf version))