题意:
给出一个数L,求一个最小的x,使长度为x的888...8这个数整除L;
无解输出0,L
题解:
即求满足下式的最小x值:
8/9*(10^x-1)==k*L (k为正整数)
8*(10^x-1)==k*9*L
为继续化简,求出r=gcd(L,8);
8/r *(10^x-1)==k*9*L/r
因为8/r与9*L/r互质,所以原式即为:...
分类:
其他好文 时间:
2015-06-29 20:20:31
阅读次数:
130
题目连接http://acm.hdu.edu.cn/showproblem.php?pid=5146SequenceDescriptionToday we have a number sequence A includes n elements.Nero thinks a number sequen...
分类:
其他好文 时间:
2015-06-29 20:16:45
阅读次数:
114
常用的表单验证指令1. 必填项验证某个表单输入是否已填写,只要在输入字段元素上添加HTML5标记required即可: 2. 最小长度验证表单输入的文本长度是否大于某个最小值,在输入字段上使用指令ng-minleng= "{number}": 3. 最大长度验证表单输入的文本长度是否小于或等于某个....
分类:
Web程序 时间:
2015-06-29 19:41:31
阅读次数:
112
六种数据类型:String、Number、Boolean、undefined、Null 、symbol(new in ECMAScript 6)和obeject1 使用typeof来检测数据类型2 数组类型判断 在ECMAscript 5中可以使用Array.isArray()函数,返回值为true...
分类:
其他好文 时间:
2015-06-29 19:36:12
阅读次数:
183
其实使用分析函数进行处理是很好的方式,翻一下Tom的书,将其中的一个例子收录在这里. 比如查询scott.emp表的用户SAL排序信息,可以使用如下查询:SQL> SELECT deptno, ename, 2 ROW_NUMBER () OVER (PARTITION BY de...
分类:
其他好文 时间:
2015-06-29 19:35:12
阅读次数:
104
1、对于string,number等基础类型,==和===是有区别的1)不同类型间比较,==之比较“转化成同一类型后的值”看“值”是否相等,===如果类型不同,其结果就是不等2)同类型比较,直接进行“值”比较,两者结果一样2、对于Array,Object等高级类型,==和===是没有区别的进行“指针...
分类:
Web程序 时间:
2015-06-29 16:39:55
阅读次数:
145
Find the Weak Connected Component in the Directed GraphFind the number Weak Connected Component in the directed graph. Each node in the graph contains...
分类:
其他好文 时间:
2015-06-29 14:33:09
阅读次数:
125
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exactly...
分类:
其他好文 时间:
2015-06-29 13:24:20
阅读次数:
105
Find the Connected Component in the Undirected GraphFind the number connected component in the undirected graph. Each node in the graph contains a lab...
分类:
其他好文 时间:
2015-06-28 22:50:42
阅读次数:
649