fork(1) download
  1. #include <iostream>
  2. #include <cstdint>
  3.  
  4. #include <x86intrin.h>
  5.  
  6. inline std::size_t ktoryBitHeHe(std::uint32_t value) {
  7. if (value > 0) {
  8. return _bit_scan_reverse(value) + 1;
  9. } else {
  10. return 0;
  11. }
  12. }
  13.  
  14. int main() {
  15. std::cout << ktoryBitHeHe(15) << ktoryBitHeHe(64);
  16. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
47