2018 ACM 国际大学生程序设计竞赛上海大都会赛重现赛 J Beautiful Numbers (数位DP)

链接:https://ac.nowcoder.com/acm/contest/163/J?&headNav=acm来源:牛客网

时间限制:C/C++ 8秒,其他语言16秒

空间限制:C/C++ 262144K,其他语言524288K

64bit IO Format: %lld

题目描述

NIBGNAUK is an odd boy and his taste is strange as well. It seems to him that a positive integer number is beautiful if and only if it is divisible by the sum of its digits.

We will not argue with this and just count the quantity of beautiful numbers from 1 to N.

输入描述:

The first line of the input is T(1≤ T ≤ 100), which stands for the number of test cases you need to solve.Each test case contains a line with a positive integer N (1 ≤ N ≤ 1012).

输出描述:

For each test case, print the case number and the quantity of beautiful numbers in [1, N].

示例1

输入

[复制](javascript:void(0)

最新文章

  1. Repeater 控件
  2. spring.net 配置文件需要注意换行问题
  3. ASP.NET MVC TagBuilder使用
  4. 从网页上抓取Windows补丁信息然后整型输出(PowerShell)
  5. LSP遇到的问题
  6. [OC Foundation框架 - 10] NSDictionary
  7. geotools导入shp文件到Oracle数据库时表名带下划线的问题解决
  8. 磁珠在PCB中的应用
  9. hdu1292(递推dp)
  10. Sass与Compress实战:第七章
  11. Android客户端连接服务器端,向服务器端发送请求HttpURLConnection
  12. PL/SQL FAQ in installation "make sure you have the 32 bits Oracle client installed" and "Database character set(AL32UTF8) and Client character set (GBK) are different"
  13. R语言︱ 数据库SQL-R连接与SQL语句执行(RODBC、sqldf包)
  14. Batch update returned unexpected row count from update [0] 异常处理
  15. mysql tp5 find_in_set写法
  16. 【转贴】一次 JDBC 与 MySQL 因 “CST” 时区协商误解导致时间差了 14 或 13 小时的排错经历
  17. Codeforces389D(SummerTrainingDay01-J)
  18. PAT A1099 Build A Binary Search Tree (30 分)——二叉搜索树,中序遍历,层序遍历
  19. Keil5下载STM32库
  20. STS maven build 访问 jsp页面报错

热门文章

  1. 使用Vulcan工具构建真实的业务负载进行网络压力测试,满足SD-WAN,White-box Switch的Performance,QoE,SLA测试要求
  2. 关于VS2010工程各种路径注意事项汇总
  3. 移动架构-json解析框架
  4. mac清除launchpad 应用程序和图标
  5. mysql中mysql数据库丢失报错Can't open the mysql.plugin table
  6. SpringBoot+Vue前后端分离,使用SpringSecurity完美处理权限问题
  7. IntelliJ IDEA 联想代码
  8. Available time
  9. LC 144. / 94. / 145. Binary Tree Preorder/ Inorder/ PostOrder Traversal
  10. css — 权重、继承性、排版、float