help about bitmask

Правка en1, от Harolinch, 2018-08-21 15:48:29

i'm trying to solve a dp problem involves bitmasks and when i see others code, all of them have the these lines

for(mask = 0; mask < (1 << k); mask++){
    ..
    for(submask = (mask - 1) & mask; submask > 0; submask = (submask - 1) & mask){
        ..
    }

what these lines means ?

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский Harolinch 2018-08-21 15:48:29 331 Initial revision (published)