Skip to content

Instantly share code, notes, and snippets.

@c-yan
Created March 9, 2020 03:47
Show Gist options
  • Save c-yan/c9bd5173edd8c02c340bfc058d7ea032 to your computer and use it in GitHub Desktop.
Save c-yan/c9bd5173edd8c02c340bfc058d7ea032 to your computer and use it in GitHub Desktop.
L = int(input(), 2)
result = 0
for a in range(L + 1):
for b in range(L + 1):
if a + b > L:
continue
if a + b != a ^ b:
continue
result += 1
print(result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment