面试题43:1-n整数中1出现的次数(数位dp)

题意:给定一个数n,问从1到n中,0~9这10个数字分别出现了多少次。好比366这个数,3出现了1次,6出现了2次。ios 我用的数位dp,dfs参数有些东西没用,仅仅为了调试。spa #include <iostream> #include <vector> #include <string> #include <algorithm> #include <stdio.h> using names
相关文章
相关标签/搜索