# Log on several maps optimization

log logarithmic mapping optimization

  • Using a mathematical technique: $ \ forall k \ in [0,35], 2 ^ {k} mod 37 equal to each other, an integer of 1-36 and just take over $
  • Application: The range within int \ (2 ^ k mapped to K \) , Math library is a logarithmic function of the base e real arithmetic, constant greater complexity, use the hash maps optimization
for(int i=0;i<36;i++)H[(1ll<<i)%37]=i;

Guess you like

Origin www.cnblogs.com/sstealer/p/11117212.html