2018 ACM 国际大学生程序设计竞赛上海大都会赛重现赛 J Beautiful Numbers (数位DP)
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)
2018 ACM 国际大学生程序设计竞赛上海大都会赛重现赛 J Beautiful Numbers (数位DP)的更多相关文章
- 2018 ACM 国际大学生程序设计竞赛上海大都会部分题解
题目链接 2018 ACM 国际大学生程序设计竞赛上海大都会 下午午休起床被同学叫去打比赛233 然后已经过了2.5h了 先挑过得多的做了 .... A题 rand x*n 次点,每次judge一个点 ...
- 2018 ACM 国际大学生程序设计竞赛上海大都会赛重现赛 F Color it
链接:https://www.nowcoder.com/acm/contest/163/F 来源:牛客网 2018 ACM 国际大学生程序设计竞赛上海大都会赛重现赛 F Color it 时间限制:C ...
- 2018 ACM 国际大学生程序设计竞赛上海大都会赛重现赛 F Color it (扫描线)
2018 ACM 国际大学生程序设计竞赛上海大都会赛重现赛 F Color it (扫描线) 链接:https://ac.nowcoder.com/acm/contest/163/F来源:牛客网 时间 ...
- 2018 ACM 国际大学生程序设计竞赛上海大都会赛
传送门:2018 ACM 国际大学生程序设计竞赛上海大都会赛 2018 ACM 国际大学生程序设计竞赛上海大都会赛重现赛2018-08-05 12:00:00 至 2018-08-05 17:00:0 ...
- 2018 ACM 国际大学生程序设计竞赛上海大都会赛重现赛 J Beautiful Numbers (数位dp)
题目链接:https://ac.nowcoder.com/acm/contest/163/J 题目大意:给定一个数N,求区间[1,N]中满足可以整除它各个数位之和的数的个数.(1 ≤ N ≤ 1012 ...
- 2018 ACM 国际大学生程序设计竞赛上海大都会赛重现赛 A,D
A链接:https://www.nowcoder.com/acm/contest/163/A Fruit Ninja is a juicy action game enjoyed by million ...
- 2018 ACM 国际大学生程序设计竞赛上海大都会 F - Color it (扫描线)
题意:一个N*M的矩形,每个点初始都是白色的,有Q次操作,每次操作将以(x,y)为圆心,r为半径的区域涂成黑点.求最后剩余白色点数. 分析:对每行,将Q次操作在该行的涂色视作一段区间,那么该行最后的白 ...
- 2018 ACM 国际大学生程序设计竞赛上海大都会赛重现赛-B-Perfect Numbers(完数)
题目描述 We consider a positive integer perfect, if and only if it is equal to the sum of its positive d ...
- 2018 ACM 国际大学生程序设计竞赛上海大都会赛重现赛-K-Matrix Multiplication(矩阵乘法)
题目描述 In mathematics, matrix multiplication or matrix product is a binary operation that produces a m ...
随机推荐
- laydate时间控件:开始时间,结束时间最大最小值
时间控件地址及插件下载链接:https://www.layui.com/doc/modules/laydate.html 填充时间已两个功能为例: 1.添加功能 :时间 规则:选择开始时间后,点击结束 ...
- C#使用Castle实现AOP面向切面编程
Castle.Core 本质是创建继承原来类的代理类,重写虚方法实现AOP功能.个人觉得比Autofac用着爽 使用方式比较简单,先新建一个控制台项目,然后在Nuget上搜索Castle.Core并安 ...
- python 实现快速排序(面试经常问到)
# -*- coding: UTF-8 -*- # 递归实现, 把过程打印出来便于理解 def quick_sort1(lis, start, end): if start >= end: re ...
- golang 切片和map查询比较
package main import ( "fmt" "time" ) var testTimeSlice = []string{"aa" ...
- Git在新电脑拉github 上的项目
非小白教程.多少有点了解的才能看懂. 1,安装git 忽略,任意i找一个图文教程即可 2,在命令行模式 输入 cd ~/.ssh/ 进入c:administrator的文件下的.ssh文件夹: 或者 ...
- Fiddler之打断点
1..Fiddler可以修改以下请求 --Fiddler设置断点,可以修改HTTP请求头信息,如修改Cookie,User-Agent等 --可以修改请求数据,突破表单限制,提交任意数字,如充值最小1 ...
- C++Primer 5th Chap5 Statements
else语句对应的始终是最近的那条if语句,除非有{}强行控制,如: if(A){ if(B){/*.............*/} }else{/*.......*/}//这里else和if(A)对 ...
- PHP和Memcached - Memcached的介绍及常用命令
1.什么是Memcached 自由开源的,高性能,分布式内存对象缓存系统,分布式是基于客户的缓存系统,服务器之间是不相互通讯的. 2.Memcached的使用场景 储存session. 缓存数据. 解 ...
- SAS学习笔记17 SAS生成随机数函数(rand function)
- 用c++ sttring检测名字是否有空格
name.find(' ') == std::string::npos//npos==-1,表示没找到