题解: 定义每个数的权值为出现的次数乘上位数上的权值,比如十位就乘以10。 #include <bits/stdc++.h> //#define int long long using namespace std; int a[100],lead[1000],vis[100],b[100]; char s[1000]; int qmi(int a,int b) { int res=1; while(b){ if(b&1) res=res*a; a=a*a;