Lang:Python2
Edit12345678910111213141516171819202122232425262728293031import redef check_is_good(num,str):total_list = []count = 0length = len(num)for i in range(length-1):total = num[i]for j in range(length):#tmp = num[i]+num[j]#total_list.append(tmp)total += num[j]total_list.append(total)total_list = list(set(total_list))if len(total_list)!=0:for item in total_list:if item.find(str)!=-1:count+=1if count==1:return countelse:return 0if __name__ == '__main__':n,s = input().split(' ')n = int(n)maxs = ''num = '9'for i in range(n):maxs +=nummaxs = int(maxs)total_count = 0