Browse Source

...

master^2
nwerc-082 2 years ago
parent
commit
0231d45937
1 changed files with 12 additions and 0 deletions
  1. 12
    0
      H.py

+ 12
- 0
H.py View File

@@ -0,0 +1,12 @@
1
+from __future__ import print_function
2
+import sys
3
+def to_int(x):
4
+  bs = []
5
+  for b in x:
6
+    if bs and bs[-1]:
7
+      bs.append(0 if b == "1" else 1)
8
+    else:
9
+      bs.append(1 if b == "1" else 0)
10
+  return int("".join(map(str, bs)), 2)
11
+n, a, b = sys.stdin.readline().split(); n = int(n)
12
+print(to_int(b) - to_int(a) - 1)

Loading…
Cancel
Save