B题最简单的做法,仅仅几行 import math def result(n): if n==1: return 1 pow=math.ceil(math.log(n,2)) day=1+pow return day T=int(input()) stack=[] for i in range(T): day=result(int(input())) print(day)