Bit Array in C++

前端 未结 8 1066
旧时难觅i
旧时难觅i 2021-02-05 06:09

When working with Project Euler problems I often need large (> 10**7) bit array\'s.

My normal approach is one of:

bool* sieve = new bool[N];

bool sieve[         


        
8条回答
  •  醉话见心
    2021-02-05 07:02

    If N is known at compile time, use std::bitset, otherwise use boost::dynamic_bitset.

提交回复
热议问题