#1#2#3AC,#7WA,剩下全MLE
查看原帖
#1#2#3AC,#7WA,剩下全MLE
565707
mediocre_楼主2022/8/11 20:09
#include<bits/stdc++.h>
using namespace std;
const int N = 2e5 + 6;
int b[N] = {0,1,2,3,4,5,6,7,8,9};
int c[10] = {0,0,0,0,0,0,0,0,0,0};
int n,m;
void dfs(int x){
	if (x > m)return;
	char a[105];
	snprintf(a,sizeof(a),"%d",x);
    for (register int j = 0;a[j] != '\0';++j)c[a[j] - '0']++;
    dfs(x + 1);
}
int main(){
	scanf("%d%d",&n,&m);
	dfs(n);
	for (register int i = 0;i <= 9;++i)printf("%d ",c[i]);
	return 0;
}
2022/8/11 20:09
加载中...