TOPIC

Wrong answer (50%)

Pether asked 3 months ago

Algúem me ajuda? Deu certo com todos os casos de teste do uDebug, mas dá WA(50%)

Question solved. Code removed.

This topic was solved and cannot recieve new replies.

  • feodorv replied 3 months ago

    Oh, please, try to evade the float functions with the integer arithmetic. You can easily check that a positive number is a power of 2 as

    (num & (num - 1)) == 0

    https://stackoverflow.com/questions/600293/how-to-check-if-a-number-is-a-power-of-2

  • Pether replied 3 months ago

    Okay, thank you very much!