有两个数据WA了 求助大佬帮我看看
查看原帖
有两个数据WA了 求助大佬帮我看看
464816
cxcxcxcx0911楼主2024/8/18 13:29
s=(input())
n=int(input())
def pd(s,n):
         if n==0:
                  return s
         li=list(s)
         if len(s)==n:
                  return '0'
         for i in range(0,len(s)-2):
                  if li[i]>li[i+1]:
                           li[i]=''
                           return pd(''.join(li),n-1)
         return pd(s[:len(s)-1:],n-1)
sc=pd(s,n)
while sc[0]=='0' and len(sc)!=1:
         sc=sc[1::]
print(sc)

2024/8/18 13:29
加载中...