HDU 4937 Lucky Number
题目链接
题意:给定一个数字,求它再x进制下,每位进制位上都只有3,4,5,6,求这样的x有多少种,如果无限种输出-1
思路:首先3 4 5 6特判掉是无限的,很容易想到就不证明了,然后就是枚举数字的最后一位3,4,5,6,然后进制数肯定来自这个数字的因子,因为剩下的数字肯定是a1x^1 + a2x^2 + a3x^3...这样的,这样...
分类:
其他好文 时间:
2014-08-13 01:15:45
阅读次数:
222
当进制转换后所剩下的为数较少时(2位,3位),对应的base都比较大,可以用数学的方法计算出来。
预处理掉转换后位数为3位后,base就小于n的3次方了,可以暴力计算。。。。
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)
Total Submissio...
分类:
其他好文 时间:
2014-08-13 01:10:24
阅读次数:
186
function TimeSpan(h, m, s) { this.h = Number(h); this.m = Number(m); this.s = Number(s);}TimeSpan.prototype = { timer: null, stop: func...
分类:
编程语言 时间:
2014-08-13 00:52:14
阅读次数:
210
本文总结nan和inf在C语言当中的含义、产生和判定方法。C语言当中的nan表示not a number,等同于 #IND:indeterminate (windows)产生:对浮点数进行了未定义的操作;对负数开方,对负数求对数,0.0/0.0,0.0*inf、inf/inf、inf-inf这些操作...
分类:
编程语言 时间:
2014-08-13 00:51:35
阅读次数:
3795
KMP算法的定义及KMP练手题 HDU 1711 Number Sequence (我的KMP模板代码)...
分类:
其他好文 时间:
2014-08-12 22:14:05
阅读次数:
253
C - Picture
Time Limit:2000MS Memory Limit:10000KB 64bit IO Format:%I64d
& %I64u
Submit Status
Description
A number of rectangular posters, photographs and other pictures of ...
分类:
其他好文 时间:
2014-08-12 22:08:14
阅读次数:
460
题目参考自博客:http://blog.csdn.net/a601025382s/article/details/38517783//string &replace(iterator first0, iterator last0,const_iterator first, const_iterato...
分类:
其他好文 时间:
2014-08-12 21:43:04
阅读次数:
278
把所有合法的进制打出来会发现合法的进制都是在
n/3 n/4 n/5的边上
然后暴力边上的进制数。。
#include
#include
typedef long long ll;
bool ok(ll x, ll y) {
ll v;
while (x > 0) {
v = x % y;
if (v != 3 && v != ...
分类:
其他好文 时间:
2014-08-12 19:11:45
阅读次数:
164
题:Minimum Inversion Number
题意:给出一个序列,如果某一项比它前面的项小(本来应该是一次增大的),这就是一组逆序项,如例:1 3 6 9 0 8 5 7 4 2就有22组逆序项。(1,0)(3,0)(3,2)(6,0)(6,5)(6,4)(9,0)(9,8)(9,5)。。。现在你可以将x1移至最后,再将x2移至最后,直到把xn-1移到最后(xn移到最后无意义),在这过程...
分类:
其他好文 时间:
2014-08-12 19:10:24
阅读次数:
264
Description
A number of schools are connected to a computer network. Agreements have been developed among those schools: each school maintains a list of schools to which it distributes software (the ...
分类:
Web程序 时间:
2014-08-12 19:01:14
阅读次数:
471