Submission #2975499


Source Code Expand

from collections import defaultdict
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
AtoZ = [chr(i) for i in range(65,65+26)]
atoz = [chr(i) for i in range(97,97+26)]

def inpl(): return list(map(int, input().split()))
def inpl_s(): return list(input().split())

N,S,T = inpl()
ans = 0

def UP(x,n):
	if x == T:
		print(n)
		return True
	elif x > T:
		return False
	else:
		return UP(x*2,n+1) or UP(x*2+1,n+1)

if not UP(S,0):
	print(-1)

Submission Info

Submission Time
Task B - Camphor Tree
User simamumu
Language Python (3.4.3)
Score 0
Code Size 551 Byte
Status TLE
Exec Time 1056 ms
Memory 4204 KB

Judge Result

Set Name All
Score / Max Score 0 / 100
Status
AC × 12
TLE × 1
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 29 ms 4196 KB
01_sample AC 29 ms 4204 KB
02_sample AC 29 ms 4196 KB
max_01 TLE 1056 ms 4200 KB
max_02 AC 29 ms 4200 KB
max_03 AC 29 ms 4200 KB
max_04 AC 29 ms 4196 KB
max_05 AC 29 ms 4196 KB
max_06 AC 28 ms 4200 KB
max_07 AC 29 ms 4200 KB
max_08 AC 29 ms 4200 KB
max_09 AC 30 ms 4196 KB
min_00 AC 29 ms 4200 KB