Create Time: 28th February 2024
Title: "[[Enumeration]]"
Author:
- AllenYGY
status: DONE
tags:
- NOTE
- Enumernation
- Algorithm
created: 2024-01-15
updated: 2024-05-31T00:55
Enumeration
枚举
自右向左取
for(int i = 1; i < (1 << n) ; ++i){
for(int j = 0 ; j < n ; ++j){
if( i & (1 << j )){
}
}
}
自左向右取
for(int i = 1; i < (1 << n); ++i){
for(int j = 0 ; j < n ; ++j){
if( (i >> n ) & 1){
}
}
}