Submission #12833545


Source Code Expand

Copy
C, D = map(int, input().split())
L = []
l, r = 140, 170
while l <= int(1e15):
    L.append([l, r])
    l *= 2
    r *= 2
cnt = 0
for i in L:
    if C < i[0] and i[1] <= D:
        cnt += i[1] - i[0]
    elif C < i[0] and i[0] <= D <= i[1]:
        cnt += D - i[0]
    elif i[0] <= C <= i[1] and i[1] < D:
        cnt += i[1] - C
    elif i[0] <= C <= i[1] and i[0] <= D <= i[1]:
        cnt += D - C
print(cnt)

Submission Info

Submission Time
Task A - Feel the Beat
User DivineJK
Language Python3 (3.4.3)
Score 300
Code Size 427 Byte
Status
Exec Time 17 ms
Memory 3064 KB

Judge Result

Set Name Score / Max Score Test Cases
Sample 0 / 0 a01, a02, a03
All 300 / 300 a01, a02, a03, b04, b05, b06, b07, b08, b09, b10, b11, b12, b13, b14, b15
Case Name Status Exec Time Memory
a01 17 ms 3064 KB
a02 17 ms 3064 KB
a03 17 ms 3064 KB
b04 17 ms 3064 KB
b05 17 ms 3064 KB
b06 17 ms 3064 KB
b07 17 ms 3064 KB
b08 17 ms 3064 KB
b09 17 ms 3064 KB
b10 17 ms 3064 KB
b11 17 ms 3064 KB
b12 17 ms 3064 KB
b13 17 ms 3064 KB
b14 17 ms 3064 KB
b15 17 ms 3064 KB