Submission #3386726


Source Code Expand

def isleft(n,h):
  for i in range(1,h+1):
    if 2**i<=n<2**i+2**i-2**(i-1):
      return (True,i)
    elif 2**i+2**i-2**(i-1)<=n<2**(i+1):
      return (False,i)
  else:
    return (False,0)

n,s,t=map(int,input().split())
rs,rt=isleft(s,n),isleft(t,n)
if s<=t:
  if s==1 or t==1:
    print(max(rs[1],rt[1]))
  if rs[0]==rt[0] and rs[0] and rt[0]:
    print(rt[1]-rs[1])
else:
  print(-1)

Submission Info

Submission Time
Task B - Camphor Tree
User tallestorange
Language Python (3.4.3)
Score 0
Code Size 406 Byte
Status WA
Exec Time 17 ms
Memory 3064 KB

Judge Result

Set Name All
Score / Max Score 0 / 100
Status
AC × 11
WA × 2
Set Name Test Cases
All 00_sample, 01_sample, 02_sample, max_01, max_02, max_03, max_04, max_05, max_06, max_07, max_08, max_09, min_00
Case Name Status Exec Time Memory
00_sample AC 17 ms 3064 KB
01_sample AC 17 ms 3064 KB
02_sample AC 17 ms 3064 KB
max_01 AC 17 ms 3064 KB
max_02 WA 17 ms 3064 KB
max_03 AC 17 ms 3064 KB
max_04 AC 17 ms 3064 KB
max_05 AC 17 ms 3064 KB
max_06 AC 17 ms 3064 KB
max_07 WA 17 ms 3064 KB
max_08 AC 17 ms 3064 KB
max_09 AC 17 ms 3064 KB
min_00 AC 17 ms 3064 KB