Skip to content

Instantly share code, notes, and snippets.

@c-yan
Created March 9, 2020 03:47

Revisions

  1. c-yan created this gist Mar 9, 2020.
    11 changes: 11 additions & 0 deletions abc129e-naive.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    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)