first commit
from old repository to a new repository
This commit is contained in:
18
boj/2885.py
Normal file
18
boj/2885.py
Normal file
@@ -0,0 +1,18 @@
|
||||
k=int(input())
|
||||
n=1
|
||||
|
||||
while n<k:
|
||||
n*=2
|
||||
|
||||
count=0
|
||||
s=0
|
||||
d=n
|
||||
if not n==k:
|
||||
while not s==k:
|
||||
di=d//2
|
||||
if s+di<=k:
|
||||
s+=di
|
||||
d/=2
|
||||
count+=1
|
||||
|
||||
print(n,count)
|
||||
Reference in New Issue
Block a user