提交时间:2025-01-04 11:54:27
运行 ID: 52170
n = int(input()) Queue = [1,2,3,4,5,6,7,8,9] f = 0 cnt = 0 flag = True while flag: end = Queue[f]%10 for i in range(end, 10): new = Queue[f]*10 + i Queue.append(new) if new>n: Queue.pop() flag = False break f += 1 print(len(Queue)-9)