Skip to content

Instantly share code, notes, and snippets.

@lrlucena

lrlucena/d12.poti

Created May 23, 2019
Embed
What would you like to do?
zero = BigInt(0)
var entrada = leia_texto
enquanto entrada <> None.orNull faça
n = BigInt(entrada)
var pos = 0
enquanto zero.setBit(pos) < n faça
pos := pos + 1
fim
head = zero.setBit(pos)
escreva "{n} {se head==n então "true {pos}" senão "false" fim}"
entrada := leia_texto
fim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment