分析:

举个样例xxx(三位数)为魔力数,则xxx|(xxx+1000*y),那么xxx|1000,这个就是结论

同理:四位数xxxx|10000,五位数xxxxx|100000

代码:

#include<iostream>
#include<cstdio>
#include<cmath>
#include<map>
#include<queue>
#include<cstring>
#include<algorithm>
typedef long long LL;
using namespace std; const int maxn=600005;
LL p[maxn];
int main()
{
LL a,b;
while(~scanf("%lld%lld",&a,&b))
{
LL cnt=0;
for(LL i=10;i<1000000000000;i*=10)
{
for(LL j=10;j>1;j--)
if(i%j==0&&i/j>=i/10)p[cnt++]=i/j;
}
sort(p,p+cnt);
LL ans=upper_bound(p,p+cnt,b)-lower_bound(p,p+cnt,a);
printf("%lld\n",ans);
}
return 0;
}

最新文章

  1. 【.NET】Cookie操作类
  2. 机器学习&amp;数据挖掘笔记_16(常见面试之机器学习算法思想简单梳理)
  3. JAVA语言学习笔记(一)
  4. java中重载、覆盖和隐藏三者的区别分析
  5. echo、print、sprint、sprintf输出
  6. find_cmd函数分析
  7. 解题报告 HDU1159 Common Subsequence
  8. random 函数
  9. shell 参数记录
  10. golang判断文件是否存在
  11. 【设计原则和编程技巧】单一职责原则 (Single Responsibility Principle, SRP)
  12. 行为驱动:Cucumber + Selenium + Java(二) - extentreports 测试报告+jenkins持续集成
  13. js的eval代码快速解密
  14. JAVA微信支付代码(WeChatPay.java 才是调用类)
  15. Linux 用户管理【UID和GID】
  16. sqlite 时间戳转时间
  17. django实现瀑布流、组合搜索、阶梯评论、验证码
  18. poj2411 Mondriaan&#39;s Dream【状压DP】
  19. apache2.2控制目录文件访问设置
  20. AndroidStudio项目提交(更新)到github最具体步骤

热门文章

  1. 三:Storm设计一个Topology用来统计单词的TopN的实例
  2. 更换163的yum源
  3. Java数组的十大方法
  4. 如何严格设置php中session过期时间 (转)
  5. python的Django使用mysql基本操作
  6. ST表算法笔记
  7. 字符串匹配&amp;Rabin-Karp算法讲解
  8. Python安装scrapy提示 error: Microsoft Visual C++ 14.0 is required. Get it with &quot;Microsoft Visual C++
  9. JavaScript中的Array数组详解
  10. Flip Game II -- LeetCode