#include <bits/stdc++.h>
using namespace std;
long long n;
long long ans[105];
long long a[105];
void zz(long long cnt){
while (cnt>0){
ans[cnt%10]++;
cnt/=10;
}
}//桶排,应该是吧。。
int main(){
ios::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
cin>>n;
int x=n/10000, y;
if (n<10000){
for (int i=1; i<=n; i++) zz(i);//n<1e4特判
}else {
for (long long i=1; i<=9999; i++){
zz(i);
}//判断1~9999部分
for (long long i=1; i<=x-1; i++){
memset (a, 0, sizeof(a));
y=i;
while (y>0){
a[y%10]++;
y/=10;
}
for (long long j=0; j<=9; j++){
ans[j]+=a[j]*10000;
}
}
for (long long i=0; i<=9; i++){
ans[i]+=4000*(x-1);
}
for (long long i=x*10000; i<=n; i++){
zz(i);
}
}
for (long long i=0; i<=9; i++){
cout<<ans[i]<<endl;
}
return 0;
}
这是我看了tj后写的,原本没有memset,一直也以为这个函数没什么用,但这题加了60变100,蒟蒻求原因QAQ