Advertisement
jkonefal

Untitled

Jan 26th, 2021
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. l=input().split()
  2. x=int(0)
  3. n=int(0)
  4. p=0
  5. k=len(l)-1
  6. l.append(50001)
  7. while k<len(l) and p>=0 and p<k:
  8.     s=(k+p)//2
  9.     l[s]=int(l[s])
  10.     l[s-1]=int(l[s-1])
  11.     if l[s]<50000 and  l[s-1]>=50000:
  12.         x=l[s]
  13.         n=s+1
  14.         break
  15.     if l[s]>=50000:
  16.         p=s+1
  17.         continue
  18.     if l[s]<50000:
  19.         k=s
  20. print (len(l)-n,x)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement