Login / Get an account Logout
  • view
  • edit
  • history
  • discuss

template/coldwater/bitset

struct BIT{
	ui v[8];
	void clear(){ for(int i = 0; i < 8; ++ i) v[i] = 0; }
	void set(int x){       v[x >> 5] |= 1U << (x & 31); }
	void flip(int x){      v[x >> 5] ^= 1U << (x & 31); }
	int get(int x){ return v[x >> 5] >> (x & 31) & 1; }
};
京ICP备17037022号
Site
  • Front page
  • All pages
  • Categories
  • Random page
  • Recent activity
  • Upload a file
  • Help
This page
  • Raw page source
  • Printable version
  • Delete this page