Submission #2923471


Source Code Expand

Copy
c, d = gets.split.map(&:to_i)
a = 140
b = 170

ans = 0
while a <= d
    ans += [[b, d].min - [a, c].max, 0].max
    a *= 2
    b *= 2
end
puts ans

Submission Info

Submission Time
Task A - Feel the Beat
User betrue12
Language Ruby (2.3.3)
Score 300
Code Size 158 Byte
Status
Exec Time 7 ms
Memory 3836 KB

Test Cases

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 7 ms 1788 KB
a02 7 ms 1788 KB
a03 7 ms 1788 KB
b04 7 ms 1788 KB
b05 7 ms 1788 KB
b06 7 ms 1788 KB
b07 7 ms 1788 KB
b08 7 ms 1788 KB
b09 7 ms 1788 KB
b10 7 ms 1788 KB
b11 7 ms 1788 KB
b12 7 ms 1788 KB
b13 7 ms 3836 KB
b14 7 ms 1788 KB
b15 7 ms 1788 KB